@extends('admin.layouts.container')

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

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

   <div class="form-group col-lg-6">
            <label>{{ meta('machine', getCurrentLocale()) ?? __('sessionreservations.machine') }} </label>
             <select class=" selectpicker form-control {{ $errors->has('machine_id') ? 'is-invalid' : '' }}"  data-show-subtext="true" data-live-search="true" name="machine_id">
           <option selected disabled>{{__('sessionreservations.select')}}</option>
           @foreach($machines as $row)
           <option  @if($sessionreservation ?? ''  && $sessionreservation->id) @if($row->id == $sessionreservation->machine_id) selected @endif @endif value="{{$row->id}}">{{$row->name}}</option>
           @endforeach
       </select>
            </div>
        <div class="form-group col-lg-6">
            <label>{{ meta('patient', getCurrentLocale()) ?? __('sessionreservations.patient') }} </label>
       <select class="selectpicker form-control {{ $errors->has('patient_id') ? 'is-invalid' : '' }}"  data-show-subtext="true" data-live-search="true" name="patient_id">
           <option selected disabled>{{__('sessionreservations.select')}}</option>
           @foreach($patients as $row)
           <option  @if($sessionreservation ?? ''  && $sessionreservation->id) @if($row->id == $sessionreservation->patient_id) selected @endif @endif value="{{$row->id}}">{{$row->name}}</option>
           @endforeach
       </select>
          </div>
           <div class="form-group col-lg-6">
            <label>{{ meta('technical', getCurrentLocale()) ?? __('sessionreservations.technical') }} </label>
       <select class="selectpicker form-control {{ $errors->has('technical_id') ? 'is-invalid' : '' }}" data-show-subtext="true" data-live-search="true" name="technical_id">
           <option selected disabled>{{__('sessionreservations.select')}}</option>
           @foreach($technicals as $row)
           <option  @if($sessionreservation ?? ''  && $sessionreservation->id) @if($row->id == $sessionreservation->technical_id) selected @endif @endif value="{{$row->id}}">{{$row->name}}</option>
           @endforeach
       </select>
          </div>
          
 <div class="form-group col-lg-6"> <input type="hidden" name="doctor_id" value="{{\Auth::user()->id}}"></div>
  <div class="form-group col-lg-6">
            <label>{{ meta('dating', getCurrentLocale()) ?? __('sessionreservations.dating') }} </label>
            <input type="date" class="form-control {{ $errors->has('dating') ? 'is-invalid' : '' }}" name="dating" placeholder="{{ meta('dating', getCurrentLocale()) ??__('sessionreservations.dating') }}" value='{{ old("dating", $sessionreservation->dating ?? "") }}'/>
        </div>
        
<div class="form-group col-lg-6">
            <label>{{ meta('paid', getCurrentLocale()) ?? __('sessionreservations.paid') }} </label>

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

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

            <input type="text" class="form-control {{ $errors->has('area') ? 'is-invalid' : '' }}" name="area" placeholder="{{ meta('area', getCurrentLocale()) ??__('sessionreservations.area') }}" value='{{ old("area", $sessionreservation->area ?? "") }}'/>
      
          </div>
          <div class="form-group col-lg-12">Measurment</div>
   <div class="form-group col-lg-6">
            <label>{{ meta('beforing', getCurrentLocale()) ?? __('sessionreservations.beforing') }} </label>

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

            <input type="text" class="form-control {{ $errors->has('aftering') ? 'is-invalid' : '' }}" name="aftering" placeholder="{{ meta('aftering', getCurrentLocale()) ??__('sessionreservations.aftering') }}" value='{{ old("aftering", $sessionreservation->aftering ?? "") }}'/>
      
          </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>
        let route_prefix = "{{ url(config('lfm.prefix')) }}",
            url = "{{url('/')}}/",
            imagePath = "{{asset('')}}";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
@endsection
