@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 }}" enctype="multipart/form-data">
        
        @if($offline ?? ''  && $offline->id)
            @method('PUT')
        @endif
        @csrf

    <div class="form-group col-lg-6">
            <label>{{  __('offlines.date')}}  </label>
            <input type="date" name="date" class="form-control {{ $errors->has('date') ? 'is-invalid' : '' }}" placeholder="{{  __('offlines.date')}}" value='{{ old("date", $offline->date ?? "") }}'>
        </div>
        <div class="form-group col-lg-6">
            <label>{{  __('offlines.time')}}  </label>
            <input type="time" name="time" class="form-control {{ $errors->has('time') ? 'is-invalid' : '' }}" placeholder="{{  __('offlines.time')}}" value='{{ old("time", $offline->time ?? "") }}'>
        </div>
        <div class="form-group col-lg-6">
            <label>{{  __('holds.reason')}}  </label>
            <select  name="reason_id" class="form-control {{ $errors->has('type') ? 'is-invalid' : '' }}">
                @foreach($reasons as $row)
                <option  @if($offline ?? ''  && $offline->id) @if($offline->reason_id == $row->id) selected @endif @endif value="{{$row->id}}"> {{reasonname($row->id)}} </option>
                @endforeach
            </select>
        </div>
        <div class="form-group col-lg-6">
            <label>{{  __('offlines.name')}}  </label>
            <input type="text" name="name" class="form-control {{ $errors->has('name') ? 'is-invalid' : '' }}" placeholder="{{  __('offlines.name')}}" value='{{ old("name", $offline->name ?? "") }}'>
        </div>
        <div class="form-group col-lg-6">
            <label>{{  __('offlines.email')}}  </label>
            <input type="email" name="email" class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}" placeholder="{{  __('offlines.email')}}" value='{{ old("email", $offline->email ?? "") }}'>
        </div>
        <div class="form-group col-lg-6">
            <label>{{  __('offlines.phone')}}  </label>
            <input type="number" name="phone" class="form-control {{ $errors->has('phone') ? 'is-invalid' : '' }}" placeholder="{{  __('offlines.phone')}}" value='{{ old("phone", $offline->phone ?? "") }}'>
        </div>
       

       
 
   

        {{--Start image container--}}
       
        
        <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('/')}}/",
            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



