@extends('user-layouts.user_template')
@section('content')
    <div class="content-wrapper" style="min-height: 916px;">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Store Setting
                <!-- <small>Control panel</small> -->
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url ('user') }}"><i class="fa fa-home"></i> Home</a></li>
                <li class="active">Store Setting</li>
               
            </ol>
        </section>
        <!-- Main content -->
        <section class="content container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <form class="form-horizontal" id="frm_edit_store"  enctype="multipart/form-data">
                        <div class="box-header with-border">
                            <h4 class="box-title">Edit Store</h4>
                        </div>
                        <div class="box-body">
                            <div id="edit_store_msg"></div>
                            <div class="col-lg-8 col-sm-8">
                                <div class="form-group">
                                    <label  class="col-sm-4 control-label">Store Name</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control" id="store_name" value="{{ $store_array[0]->StoreName }}" name="store_name" placeholder="Store Name" reqiured="required" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label  class="col-sm-4 control-label">Store URL</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control" readonly  value="{{ $store_array[0]->StoreUrl }}" name="store_url" placeholder="Store URL"  reqiured="required" />
                                        <input type="hidden" class="form-control" value="{{ $store_array[0]->StoreUrl }}" name="orig_store_url" reqiured="required" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">With Password</label>
                                    <div class="col-sm-8">
                                            <input type="checkbox" @if($store_array[0]->Password != null) checked @endif id="with_password_opt" name="set_store_password" data-toggle="toggle" data-width="100px" data-on="<i class='fa fa-check-circle'></i> Yes" data-off="<i class='fa fa-ban'></i> No" data-size="small">
                                    </div>
                                </div> 
                                <div class="form-group store-password-field" style="display: @if($store_array[0]->Password != null) block; @else none; @endif">
                                    <label  class="col-sm-4 control-label">Password</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control" name="store_password" value="{{ $store_array[0]->Password }}" placeholder="Store Password"  reqiured="required" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label  class="col-sm-4 control-label">Store Logo</label>
                                    <div class="col-sm-8">
                                        <input type="file" data-use-id="img_store_logo" class="form-control upload_img" name="store_logo" placeholder="Store Logo"  reqiured="required" />
                                        <input type="hidden" class="form-control" value="{{ $store_array[0]->StoreLogo }}" name="orig_store_logo" reqiured="required" />
                                        <small><i style="color: red;">Size: H:300px - W:300px</i></small>
                                    </div>
                                </div>
                                <div class="form-group" >
                                    <label  class="col-sm-4 control-label"></label>
                                    <div class="col-sm-8">
                                        <p>Store Logo Preview:</p>
                                        <div class="store-logo-holder">
                                            <a href="{{ minio_url('teamstore/' . $store_array[0]->ImageFolder . '/' . $store_array[0]->StoreLogo) }}?v={{ time() }}" class="img_store_logo_href"   data-toggle="lightbox">
                                                <img class="img_store_logo_img"  id="img_store_logo" src="{{ minio_url('teamstore/' . $store_array[0]->ImageFolder . '/' . $store_array[0]->StoreLogo) }}?v={{ time() }}" style="max-width: 100%; max-height: 100%; ">
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label  class="col-sm-4 control-label">Store Banner</label>
                                    <div class="col-sm-8">
                                        <input type="file" class="form-control upload_img" data-use-id="img_store_banner" name="store_banner" placeholder="Store Banner"  reqiured="required" />
                                        <input type="hidden" class="form-control" value="{{ $store_array[0]->StoreBanner }}" name="orig_store_banner" reqiured="required" />
                                        <small><i style="color: red;">Size: H:1140px - W:128px</i></small>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label  class="col-sm-4 control-label"></label>
                                    <div class="col-sm-8">
                                        <p>Store Banner Preview:</p>
                                        <div class="store-banner-holder">
                                            <a href="{{ minio_url('teamstore/' . $store_array[0]->ImageFolder . '/' . $store_array[0]->StoreBanner) }}?v={{ time() }}" class="img_store_banner_href"   data-toggle="lightbox">
                                                <img class="img_store_banner_img"  id="img_store_banner" src="{{ minio_url('teamstore/' . $store_array[0]->ImageFolder . '/' . $store_array[0]->StoreBanner) }}?v={{ time() }}" style="max-width: 100%; max-height: 100%;">
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label  class="col-sm-4 control-label">Store Status</label>
                                    <div class="col-sm-8">
                                        <select class="form-control" name="store_status">
                                            <option @if($store_array[0]->IsActive == "false") selected @endif>Private</option>
                                            <option @if($store_array[0]->IsActive == "true") selected @endif >Public</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="box-footer">
                            <div class="col-sm-8">
                                <div class="form-group">
                                    <label  class="col-sm-4 control-label">&nbsp;</label>
                                    <div class="col-sm-8">
                                        <button type="submit" id="btn_update_store" class="btn btn-primary">Save Changes</button>
                                        <a href="{{ url('user') }}" type="button" class="btn btn-default">Cancel</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div><!-- box  -->
            </div>
        </div>
    </section>
    <!-- /.content -->
    </div>
@endsection
