@extends('backend.layouts.app')
@section('title', @$data['title'])

@section('content')
    {!! breadcrumb([
        'title' => @$data['title'],
        route('admin.dashboard') => _trans('common.Dashboard'),
        '#' => @$data['title'],
    ]) !!}

    @include('travel::travel-plans.nav', ['plan_id' => $data['travelMeeting']->travel_plan_id, 'is_approved' => true])

    <div class="card ot-card">
        <div class="card-body">
            <form 
                method="POST" 
                action="{{ route('travel.plans.meetings.update', ['plan_id' => $data['travelMeeting']->travel_plan_id, 'id' => $data['travelMeeting']->id]) }}" 
                enctype="multipart/form-data" 
                autocomplete="off"
            >
                @csrf
                @method('PUT')
                <div class="col-md-12">
                    <div class="row form-group mb-5 text-start">
                        <label class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end"></label>
                        <div class="col-md-8 col-lg-9 col-xl-10 bg-light p-3">
                            <h3>{{ _trans('common.Edit Meeting Form') }}</h3>
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="date" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Date') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="date" name="date" class="form-control ot-form-control ot-input" value="{{ old('date', $data['travelMeeting']->date) }}" required>
                            @if ($errors->has('date'))
                                <span class="error text-danger">
                                    {{ $errors->first('date') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="meeting_schedule_time" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Schedule Time') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="time" name="meeting_schedule_time" class="form-control ot-form-control ot-input" value="{{ old('meeting_schedule_time', $data['travelMeeting']->meeting_schedule_time) }}" required>
                            @if ($errors->has('meeting_schedule_time'))
                                <span class="error text-danger">
                                    {{ $errors->first('meeting_schedule_time') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="meeting_start_time" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Start Time') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="time" name="meeting_start_time" class="form-control ot-form-control ot-input" value="{{ old('meeting_start_time', $data['travelMeeting']->meeting_start_time) }}" required>
                            @if ($errors->has('meeting_start_time'))
                                <span class="error text-danger">
                                    {{ $errors->first('meeting_start_time') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="meeting_end_time" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.End Time') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="time" name="meeting_end_time" class="form-control ot-form-control ot-input" value="{{ old('meeting_end_time', $data['travelMeeting']->meeting_end_time) }}" required>
                            @if ($errors->has('meeting_end_time'))
                                <span class="error text-danger">
                                    {{ $errors->first('meeting_end_time') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="customer_company_name" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Company Name') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="text" name="customer_company_name" class="form-control ot-form-control ot-input" placeholder="{{ _trans('common.Company Name') }}" value="{{ old('customer_company_name', $data['travelMeeting']->customer_company_name) }}" required>
                            @if ($errors->has('customer_company_name'))
                                <span class="error text-danger">
                                    {{ $errors->first('customer_company_name') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="customer_name" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Customer Name') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="text" name="customer_name" class="form-control ot-form-control ot-input" placeholder="{{ _trans('common.Customer Name') }}" value="{{ old('customer_name', $data['travelMeeting']->customer_name) }}" required>
                            @if ($errors->has('customer_name'))
                                <span class="error text-danger">
                                    {{ $errors->first('customer_name') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="customer_email" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Customer Email') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="email" name="customer_email" class="form-control ot-form-control ot-input" placeholder="{{ _trans('common.Customer Email') }}" value="{{ old('customer_email', $data['travelMeeting']->customer_email) }}" required>
                            @if ($errors->has('customer_email'))
                                <span class="error text-danger">
                                    {{ $errors->first('customer_email') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="customer_phone" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Customer Phone') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <input type="text" name="customer_phone" class="form-control ot-form-control ot-input" placeholder="{{ _trans('common.Customer Phone') }}" value="{{ old('customer_phone', $data['travelMeeting']->customer_phone) }}" required>
                            @if ($errors->has('customer_phone'))
                                <span class="error text-danger">
                                    {{ $errors->first('customer_phone') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="purpose" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Purpose of Meeting') }} <span class="text-danger">*</span></label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <textarea name="purpose" class="form-control ot-input" placeholder="{{ _trans('common.Purpose of Meeting') }}" required>{!! nl2br(old('purpose', $data['travelMeeting']->purpose)) !!}</textarea>
                            @if ($errors->has('purpose'))
                                <span class="error text-danger">
                                    {{ $errors->first('purpose') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="remark" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Remark') }}</label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <textarea name="remark" class="form-control ot-input" placeholder="{{ _trans('common.Remark') }}">{!! nl2br(old('remark', $data['travelMeeting']->remark)) !!}</textarea>
                            @if ($errors->has('remark'))
                                <span class="error text-danger">
                                    {{ $errors->first('remark') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="remark" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.File') }}</label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <div class="ot_fileUploader left-side mb-3">
                                <input class="form-control" type="text" name="file" readonly="" id="placeholder3">
                                <button class="primary-btn-small-input" type="button">
                                    <label class="btn btn-lg ot-btn-primary m-0" for="fileBrouse3">Browse</label>
                                    <input type="file" class="d-none form-control" name="file" id="fileBrouse3">
                                </button>
                            </div>
                            @if ($errors->has('file'))
                                <span class="error text-danger">
                                    {{ $errors->first('file') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="row form-group mb-3 text-start">
                        <label for="rating_of_meeting_experience" class="col-md-4 col-lg-3 col-xl-2 form-label pt-3 text-end">{{ _trans('common.Rate Your Meeting Experience ') }}</label>
                        <div class="col-md-8 col-lg-9 col-xl-10">
                            <select name="rating_of_meeting_experience" class="form-control select2">
                                <option value="" selected></option>
                                <option value="1" {{ old('rating_of_meeting_experience', $data['travelMeeting']->rating_of_meeting_experience) == 1 ? 'selected' : '' }}>1</option>
                                <option value="2" {{ old('rating_of_meeting_experience', $data['travelMeeting']->rating_of_meeting_experience) == 2 ? 'selected' : '' }}>2</option>
                                <option value="3" {{ old('rating_of_meeting_experience', $data['travelMeeting']->rating_of_meeting_experience) == 3 ? 'selected' : '' }}>3</option>
                                <option value="4" {{ old('rating_of_meeting_experience', $data['travelMeeting']->rating_of_meeting_experience) == 4 ? 'selected' : '' }}>4</option>
                                <option value="5" {{ old('rating_of_meeting_experience', $data['travelMeeting']->rating_of_meeting_experience) == 5 ? 'selected' : '' }}>5</option>
                            </select>
                            @if ($errors->has('rating_of_meeting_experience'))
                                <span class="error text-danger">
                                    {{ $errors->first('rating_of_meeting_experience') }}
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="d-flex justify-content-end gap-2 mt-5">
                        <a href="{{ route('travel.plans.meetings.index', $data['travelMeeting']->travel_plan_id) }}" class="btn btn-secondary d-flex align-items-center gap-2">
                            <i class="las la-arrow-left fs-4"></i> 
                            {{ _trans('common.Back to list') }}
                        </a>
                        <button class="btn btn-gradian d-flex align-items-center gap-2"><i class="las la-check fs-4"></i> {{ _trans('common.Update') }}</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection