@extends('canteen.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">{{__('canteens.details')}}</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">{{__('canteens.user_info')}}</span>
                </a>
            </li>


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

            <div class="tab-content col-lg-12">
                <div class="tab-pane active" id="details">
                    <div class="row">
                        <div class="form-group col-lg-12">
                            <h3>{{  __('canteens.details') }} </h3>
                        </div>

                        @if($canteen ?? ''  && $canteen->id)
                            <div class="form-group col-lg-6">
                                <label>{{  __('canteens.code') }} </label>
                                <p class="form-control" style="height: auto">#{{$canteen->code}}</p>
                            </div>
                            <div class="form-group col-lg-6">
                                <label>{{  __('canteens.wallet') }} </label>
                                <p class="form-control" style="height: auto">{{$total ?? 0}}</p>
                            </div>
                        @endif

                        <div class="form-group col-lg-6">
                            <label>{{ __('canteens.school_id') }} </label>
                            <p class="form-control" style="height: auto">{{$canteen->school->currentDescription->title ?? ''}}</p>
                        </div>

                        <div class="form-group col-lg-6">
                            <label>{{ __('canteens.title') }} </label>
                            <p class="form-control" style="height: auto">{{$canteen->currentDescription->title ?? ''}}</p>
                        </div>

                        <div class="form-group col-lg-6">
                            <label>{{ __('canteens.account_name') }} </label>
                            <p class="form-control" style="height: auto">{{ $canteen->account_name ?? ''}}</p>
                        </div>

                        <div class="form-group col-lg-6">
                            <label>{{ __('canteens.account_number') }} </label>
                            <p class="form-control" style="height: auto">{{ $canteen->account_number ?? ''}}</p>
                        </div>

                        <div class="form-group col-lg-6">
                            <label>{{ __('canteens.bank_name') }} </label>
                            <p class="form-control" style="height: auto">{{ $canteen->bank_name ?? ''}}</p>
                        </div>

                        <div class="form-group col-lg-6">
                            <label>{{ __('canteens.iban') }} </label>
                            <p class="form-control" style="height: auto">{{ $canteen->iban ?? ''}}</p>
                        </div>

                    </div>

                </div>

                <div class="tab-pane " id="user_info">
                    <div class="row">
                        <div class="col-lg-12">
                            <h3>
                                {{__('canteens.user_info')}}
                            </h3>
                            <hr>
                        </div>

                        <div class="form-group col-lg-4">
                            <label>{{ __('users.id_number') }} </label>
                            <p class="form-control" style="height: auto">{{ $user->id_number ?? ''}}</p>
                        </div>
                        <div class="form-group col-lg-4">
                            <label>{{ __('users.email') }} </label>
                            <p class="form-control" style="height: auto">{{ $user->email ?? ''}}</p>
                        </div>
                        <div class="form-group col-lg-4">
                            <label>{{ __('users.phone') }} </label>
                            <p class="form-control" style="height: auto">{{ $user->phone ?? ''}}</p>
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('users.password') }} </label>
                            <input type="password" class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}" name="password" placeholder="{{ __('users.password') }}" />
                        </div>
                        <div class="form-group col-lg-6">
                            <label>{{ __('users.password_confirmation') }} </label>
                            <input type="password" class="form-control {{ $errors->has('password_confirmation') ? 'is-invalid' : '' }}" name="password_confirmation" placeholder="{{ __('users.password_confirmation') }}" />
                        </div>
                        <div class="form-group col-lg-12 image_container" >
                            <h6>{{ meta('image', getCurrentLocale()) ?? __('canteens.image') }} </h6>
                            <img src="{{asset(old('photo', $user->photo ?? ''))}} "  class="image_holder"/>
                        </div>


                    </div>
                </div>



            </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 orders -->
    <script src="{{ asset('/assets/admin/js/lib/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



