@extends('admin.layouts.container')

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

    <div class="border-item">
        <form class="form-row" method="post" @if($show) action="{{ $action }}" @endif>
                @method('PUT')
            @CSRF

            <div class="form-group col-lg-6">
                <label>{{ meta('name', getCurrentLocale()) ?? __('members.name') }} </label>
                <input class="form-control {{ $errors->has('name') ? 'is-invalid' : '' }}" disabled placeholder="{{ meta('name', getCurrentLocale()) ??__('members.name') }}" value='{{ old("name", $user->name ?? "") }}'/>
            </div>

            <div class="form-group col-lg-6">
                <label>{{ meta('email', getCurrentLocale()) ?? __('members.email') }} </label>
                <input  class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}" disabled placeholder="{{ meta('email', getCurrentLocale()) ?? __('members.email') }}" value='{{ old("email", $user->email ?? "") }}'/>
            </div>

            <div class="form-group col-lg-6">
                <label>{{ meta('phone', getCurrentLocale()) ?? __('members.phone') }} </label>
                <input  class="form-control {{ $errors->has('phone') ? 'is-invalid' : '' }}" disabled placeholder="{{ meta('phone', getCurrentLocale()) ?? __('members.phone') }}" value='{{ old("phone", $user->phone ?? "") }}'/>
            </div>
            @if($show) 
                <div class="text-center mt-5 col-6">
                    <button class="butn"><span>{{ __('dashboard.pay') }}</span></button>
                </div>
            @endif
            <div class="col-lg-12">
                <h3>{{__('commissions.orders')}}</h3>
            </div>
            <div class="col-lg-12 row" >
                
                @foreach($orders as $i=>$order)
                    <div class="col-lg-12 " >
                        <div class="row">
                            <div class="form-group col-lg-4">
                                <label>{{  __('orders.id') }}  </label>
                                <input type="text" class="form-control " disabled value='{{  $order->id  }}'/>
                            </div>
                            
                            <div class="form-group col-lg-4">
                                <label>{{  __('commissions.seller_payment_status') }}  </label>
                                <input type="text" class="form-control " disabled value='{{  __("commissions.".$order->seller_payment_status)  }}'/>
                            </div>
        
                            <div class="form-group col-lg-4">
                                <label>{{  __('commissions.total_commission') }}  </label>
                                <input type="text" class="form-control " disabled value='{{  $order->total_commission  }}'/>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </form>
    </div>

@endsection

@section('inner_js')
    <!-- Editor JS files -->
    <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
    <script>
        function countries(elem)
        {
            var data = $(elem).val();
            $.ajax({
                url : url_country,
                type : 'GET',
                data : 'id='+data,
                success:function(data)
                {
                    $('#city_id').html(data);
                }
            })
        }
    </script>
    <script>
        let route_prefix = "{{ url(config('lfm.prefix')) }}",
            url = "{{url('/')}}/",
            url_country = "{{url('/')}}/admin/country",
            imagePath = "{{asset('')}}";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
@endsection
