@extends('admin.layouts.container')

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

    </div>
    <div class="border-item">
        <form class="form-row" enctype="multipart/form-data">
            <div class="form-group col-lg-6">
                <label>{{  __('orders.child') }}  </label>
                <input type="text" class="form-control " disabled value='{{ $order->child->name }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('orders.parent') }}  </label>
                <input type="text" class="form-control " disabled value='{{ $order->child->parent->name }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('orders.canteen') }}  </label>
                <input type="text" class="form-control " disabled
                       value='{{ $order->canteen?->currentDescription->title ?? "" }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('orders.school') }}  </label>
                <input type="text" class="form-control " disabled
                       value='{{ $order->canteen->school?->currentDescription->title ?? "" }}'/>
            </div>
{{--            <div class="form-group col-lg-6">--}}
{{--                <label>{{  __('orders.total_points') }}  </label>--}}
{{--                <input type="text" class="form-control " disabled value='{{  $order->total_points  }}'/>--}}
{{--            </div>--}}
            <div class="form-group col-lg-6">
                <label>{{  __('orders.tax_cost') }}  </label>
                <input type="text" class="form-control " disabled value='{{  $order->tax_cost  }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('orders.total_management') }}  </label>
                <input type="text" class="form-control " disabled value='{{  $order->total_management  }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('orders.total_products') }}  </label>
                <input type="text" class="form-control " disabled value='{{  $order->total_products  }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('orders.total') }}  </label>
                <input type="text" class="form-control " disabled value='{{  $order->total  }}'/>
            </div>
            <div class="form-group col-lg-6">
                <label>{{  __('orders.date') }}  </label>
                <input type="text" class="form-control " disabled
                       value='{{  date("Y/m/d g:i a",strtotime($order->created_at))  }}'/>
            </div>

            <div class="col-lg-12">
                <h3>
                    {{__('orders.products')}}
                </h3>
                <hr>
            </div>
            <div class="col-lg-12">
                @foreach($order->products as $key=>$row)
                    <div class="col-lg-12 pricing-list-item border-item mb-4"  style="background-color: rgba(21,97,203,0.1);height:auto">
                        <div class="row">
                            <div class="form-group col-lg-6">
                                <label>{{  __('orders.product_name') }} </label>
                                <p class="form-control" style="height: auto">{{ $row->product->currentDescription->title }} </p>
                            </div>
                            <div class="form-group col-lg-6">
                                <label>{{  __('orders.product_cost') }} </label>
                                <p class="form-control" style="height: auto">{{ $row->product_cost }}</p>
                            </div>

                            <div class="form-group col-lg-6">
                                <label>{{  __('orders.count') }} </label>
                                <p class="form-control" style="height: auto">{{ $row->count}}</p>
                            </div>
                            <div class="form-group col-lg-6">
                                <label>{{  __('orders.product_total') }} </label>
                                <p class="form-control" style="height: auto">{{ $row->product_total}}</p>
                            </div>
                        </div>
                    </div>
                @endforeach
            </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>
        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
