@extends('admin.layouts.container')

@section('content')
    <div class="side-title">
        <h3>{{ $head }}</h3>

    </div>
    <div class="border-item">
        <form class="form-row" action="{{$action}}" method="POST" onsubmit="saveForm(this)" enctype="multipart/form-data">
            @method('PUT')
            @csrf
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.status') }}  </label>
                <select  onchange="selectStatus()" id="status" name="status" class="form-control">
                    <option value="">{{__('dashboard.select')}}</option>
                    <option value="1">{{__('edit_stores.accept')}}</option>
                    <option value="0">{{__('edit_stores.refuse')}}</option>
                </select>
            </div>
            <div class="form-group col-lg-6 refuse">
                <label>{{  __('products.message') }} </label>
                <input type="text" name="message" placeholder="{{__('products.message')}}" class="form-control">
            </div>
            <div class="form-group col-lg-6 refuse">
                <label>{{  __('products.reason_id') }} </label>
                <select name="reason_id" class="form-control">
                    <option value="">{{__('dashboard.select')}}</option>
                    @foreach($reasons as $row)
                        <option  value="{{$row->id}}">{{$row->title}}</option>
                    @endforeach
                </select>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.name') }}  </label>
                <input type="text" class="form-control " disabled value='{{ $edit_store->name }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.phone') }}  </label>
                <input type="text" class="form-control " disabled value='{{ $edit_store->phone }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.email') }}  </label>
                <input type="text" class="form-control " disabled value='{{ $edit_store->email }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.min_order') }}  </label>
                <input type="text" class="form-control " disabled value='{{ $edit_store->min_order }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.category_id') }}  </label>
                <input type="text" class="form-control " disabled value='{{ $edit_store->category->currentDescription->title }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.sub_category_id') }}  </label>
                <input type="text" class="form-control " disabled
                       value='{{ $edit_store->subCategory->currentDescription->title }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('edit_stores.store_id') }}  </label>
                <input type="text" class="form-control " disabled value='{{  $edit_store->store->name  }}'/>
            </div>
            <div class="text-center mt-5 col-12">
                <button class="butn"><span>{{ __('dashboard.save') }}</span></button>
            </div>
        </form>
    </div>

@endsection
@section('inner_js')
    <!-- Editor JS files -->
    {{--    <script src="{{ asset('/assets/admin/js/lib/tinymce.min.js') }}"></script>--}}
    <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
    <script>
        function selectStatus()
        {
            let status = $('#status').val()
            if(status == 1)
            {
                $('.refuse').hide()
            }
            else
            {
                $('.refuse').show()
            }
        }
        $('#status').trigger('change')
    </script>
    <script>
        let route_prefix = "{{ url(config('lfm.prefix')) }}",
            url = "{{url('/')}}/",
            currentLanguage = "{{getCurrentLocale()}}",
            imagePath = "{{asset('')}}";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
    <script src="{{ asset('assets/admin/js/articles.js') }}"></script>
@endsection
