@extends('admin.layouts.container')

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


    <div class="border-item">
        <ul class="nav nav-pills bg-nav-pills nav-justified mb-3">
            <li class="nav-item">
                <a href="#details" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0 active">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block">{{__('refunds.details')}}</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#payment_info" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block">{{__('refunds.card')}}</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#user_info" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block">{{__('refunds.user_info')}}</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#products" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
                    <i class="mdi mdi-home-variant d-lg-none d-block mr-1"></i>
                    <span class="d-none d-lg-block">{{__('refunds.products')}}</span>
                </a>
            </li>

        </ul>
        <form class="form-row" method="post" onsubmit="saveForm(this)" action="{{ $action }}" enctype="multipart/form-data">
            @method('PUT')
            @csrf

            <div class="tab-content col-lg-12">
                <div class="tab-pane active" id="details">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                {{__('refunds.details')}}
                            </h3>
                            <hr>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{  __('refunds.status') }} </label>
                            <select name="status" class="form-control">
                                @foreach($statuses as $row)
                                    <option {{$refund->status == $row ? 'selected' : ''}} value="{{$row}}">{{__('refunds.statuses.'.$row)}}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{  __('refunds.uuid') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->uuid}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{  __('refunds.order_id') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->order_id}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('refunds.date') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->date}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('refunds.note') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->note}}</p>
                        </div>
                        @if($refund->image)
                            <div class="form-group col-lg-6">
                                <label>{{ __('refunds.image') }} </label>
                                <img src="{{asset($refund->image)}}" width="500" height="500">
                            </div>
                        @endif
                        <div class="text-center mt-5 col-12">
                            <button class="butn"><span>{{ __('dashboard.save') }}</span></button>
                        </div>

                    </div>

                </div>
                <div class="tab-pane " id="payment_info">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                {{__('refunds.payment_info')}}
                            </h3>
                            <hr>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('refunds.card_number') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->card->card ?? '-'}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('refunds.year') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->card->year ?? '-'}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('refunds.month') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->card->month ?? '-'}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('refunds.card_type') }} </label>
                            <hr>
                            <img src="{{asset($refund->card->card_type)}}.png" width="100" height="100">
                        </div>

                    </div>
                </div>
                <div class="tab-pane " id="user_info">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                {{__('refunds.user_info')}}
                            </h3>
                            <hr>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{  __('refunds.user_name') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->order->user->name ?? ''}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{  __('refunds.user_email') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->order->user->email ?? ''}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{  __('refunds.user_phone') }} </label>
                            <p class="form-control" style="height: auto">{{$refund->order->user->phone ?? ''}}</p>
                        </div>

                    </div>
                </div>
                <div class="tab-pane" id="products">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                {{__('refunds.products')}}
                            </h3>
                            <hr>
                        </div>
                        <div class="col-lg-12">
                                <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>{{  __('refunds.product_name') }} </label>
                                            <p class="form-control" style="height: auto">{{ $refund->orderProduct->product->currentDescription->title }} {{$refund->orderProduct->option_id ? (' - '.$refund->orderProduct->option->currentDescription->title ) : '' }}</p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label>{{  __('refunds.product_main_category') }} </label>
                                            <p class="form-control" style="height: auto">{{ $refund->orderProduct->product->category->currentDescription->title }}</p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label>{{  __('refunds.product_sub_category') }} </label>
                                            <p class="form-control" style="height: auto">{{ $refund->orderProduct->product->subCategory->currentDescription->title }}</p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label>{{  __('refunds.brand') }} </label>
                                            <p class="form-control" style="height: auto">{{ $refund->orderProduct->product->brand->currentDescription->title }}</p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label>{{  __('refunds.store') }} </label>
                                            <p class="form-control" style="height: auto">{{ $refund->orderProduct->store->currentDescription->title }}</p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label>{{  __('refunds.count') }} </label>
                                            <p class="form-control" style="height: auto">{{ $refund->orderProduct->count}}</p>
                                        </div>
                                        <div class="form-group col-lg-6">
                                            <label>{{  __('refunds.product_cost') }} </label>
                                            <p class="form-control" style="height: auto">{{ $refund->orderProduct->total}}</p>
                                        </div>
                                    </div>
                                </div>
                        </div>

                    </div>
                </div>



            </div>

        </form>
    </div>

@endsection

@section('inner_js')
    <!-- Editor JS refunds -->
    <script src="{{ asset('/assets/admin/js/lib/tinymce.min.js') }}"></script>-
    <script>
        var route_prefix = "{{ url(config('lfm.prefix')) }}";
        var url = "{{url('/')}}/";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>

@endsection
