{{Form::model($meeting,array('route' => array('meeting.update', $meeting->id), 'method' => 'PUT', 'class'=>'needs-validation', 'novalidate')) }}
<div class="modal-body">
    {{-- start for ai module--}}
    @php
        $plan= \App\Models\Utility::getChatGPTSettings();
    @endphp
    @if($plan->chatgpt == 1)
    <div class="text-end">
        <a href="#" data-size="md" class="btn  btn-primary btn-icon btn-sm" data-ajax-popup-over="true" data-url="{{ route('generate',['meeting']) }}"
           data-bs-placement="top" data-title="{{ __('Generate content with AI') }}">
            <i class="fas fa-robot"></i> <span>{{__('Generate with AI')}}</span>
        </a>
    </div>
    @endif
    {{-- end for ai module--}}
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                {{Form::label('title',__('Meeting Title'),['class'=>'form-label'])}}<x-required></x-required>
                {{Form::text('title',null,array('class'=>'form-control','placeholder'=>__('Enter Meeting Title'), 'required' => 'required'))}}
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                {{Form::label('date',__('Meeting Date'),['class'=>'form-label'])}}<x-required></x-required>
                {{Form::text('date', !empty($meeting->date) ? \Carbon\Carbon::parse($meeting->date)->format('d/m/Y') : null, array('class'=>'form-control js-ddmmyyyy', 'required' => 'required', 'autocomplete' => 'off', 'placeholder' => 'DD/MM/YYYY', 'readonly' => 'readonly'))}}
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                {{Form::label('time',__('Meeting Time'),['class'=>'form-label'])}}<x-required></x-required>
                {{Form::time('time',null,array('class'=>'form-control timepicker', 'required' => 'required'))}}
            </div>
        </div>
        <div class="col-md-12">
            <div class="form-group">
                {{Form::label('note',__('Meeting Note'),['class'=>'form-label'])}}
                {{Form::textarea('note',null,array('class'=>'form-control','placeholder'=>__('Enter Meeting Note')))}}
            </div>
        </div>

    </div>
</div>
<div class="modal-footer">
    <input type="button" value="{{__('Cancel')}}" class="btn btn-secondary" data-bs-dismiss="modal">
    <input type="submit" value="{{__('Update')}}" class="btn btn-primary">
</div>
{{Form::close()}}

<script>
    $(document).ready(function() {
        var $meetingDate = $('input[name="date"].js-ddmmyyyy');
        if ($meetingDate.length) {
            $meetingDate.on('keydown paste', function (e) {
                e.preventDefault();
            });

            if (typeof flatpickr !== 'undefined') {
                if (!$meetingDate[0]._flatpickr) {
                    flatpickr($meetingDate[0], {
                        dateFormat: 'd/m/Y',
                        allowInput: false,
                        disableMobile: true
                    });
                }
            } else if ($.fn.datepicker && !$meetingDate.hasClass('hasDatepicker')) {
                $meetingDate.datepicker({
                    dateFormat: 'dd/mm/yy',
                    changeMonth: true,
                    changeYear: true,
                    yearRange: '1900:+10'
                });
            }
        }
    });
</script>

