<div class="modal fade lead-modal" id="addDutyCalendarModal" aria-labelledby="modalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content data">
            <div class="modal-header modal-header-image mb-3">
                <h5 class="modal-title text-white">{{ _trans('common.Generate') }} </h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
                    <i class="fa fa-times text-white" aria-hidden="true"></i>
                </button>
            </div>

            <div class="modal-body">
                <form action="{{ route('duty.calendar.store') }}" class="row p-2" method="post" id="add_duty_calendar_form">
                    @csrf

                    <div class="col-md-12 form-group mb-3">
                        <label class="form-label">{{ _trans('common.Department') }}</label>
                        <select name="department_id" class="form-select select2-input ot-input mb-3 modal_select2" aria-label="Default select example" onchange="selectDepartment()">
                            <option value="" selected>{{ _trans('common.Select Department') }}</option>
                            @foreach ($data['departments'] as $department)
                                <option value="{{ $department->id }}" {{ old('department_id') == $department->id ? "selected" : '' }}>
                                    {{ $department->title }}
                                </option>
                            @endforeach
                        </select>
                    </div>

                    <div class="col-md-12 form-group mb-3" id="employee_section">
                        <label class="form-label">{{ _trans('common.Employee') }}</label>
                        <select name="employee_id" class="form-select select2-input ot-input mb-3 modal_select2" aria-label="Default select example">
                            <option value="" disabled selected>{{ _trans('common.Choose One') }}</option>
                            @foreach ($data['employees'] as $employee)
                                <option value="{{ $employee->id }}" {{ old('employee_id') == $employee->id ? "selected" : '' }}>
                                    {{ $employee->name }} - {{ $employee->userID }}
                                </option>
                            @endforeach
                        </select>

                        @error('employee_id')
                            <div class="text-danger">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="col-md-12">
                        <div class="form-group mb-3">
                            <label class="form-label">{{ _trans('common.Select Dates') }} <span class="text-danger">*</span></label>
                            <input 
                                class="daterange-table-filter form-control" 
                                type="text" 
                                name="date_range" 
                                value="{{ date('m/d/Y') }}-{{ date('m/d/Y') }}" 
                                required
                            >
                        </div>
                    </div>

                    <div class="form-group d-flex justify-content-end">
                        <button id="btn_duty_calendar_crete" type="submit" class="btn btn-gradian pull-right hit_modal">{{ _trans('common.Create') }}</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
