<div class="modal fade lead-modal" id="editDutyCalendarModal" 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.Update') }} </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.update') }}" class="row p-2" method="post" id="duty_calendar_update_form">
                    @csrf

                    {{-- Hidden input --}}
                    <input type="hidden" id="duty_calendar_id" name="duty_calendar_id" value="">

                    <div class="col-md-12 form-group mb-3">
                        <label class="form-label">{{ _trans('common.Duty schedule') }}</label>
                        <select name="duty_schedule_id" id="duty_schedule_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['dutySchedules'] as $dutySchedule)
                                {{-- Format time --}}
                                <?php
                                    $startTime = \Carbon\Carbon::createFromFormat('H:i:s', $dutySchedule->start_time)->format('g:i A') ;
                                    $endTime  = \Carbon\Carbon::createFromFormat('H:i:s', $dutySchedule->end_time)->format('g:i A');
                                ?>

                                <option value="{{ $dutySchedule->id }}">
                                    {{ @$dutySchedule->shift->name }} ({{ $startTime }} - {{ $endTime }})
                                </option>
                            @endforeach
                        </select>
                    </div>

                    <div class="col-md-12 form-group mb-3 d-flex gap-2">
                        <div class="form-check d-none" id="holidayCheckboxContainer">
                            <input type="hidden" name="holiday_id" id="holiday_id" value="1">
                            <input type="checkbox" class="form-check-input" id="isHoliday" checked disabled>
                            <label id="holiday_label" class="form-check-label">{{ _trans('common.Holiday') }}</label> <br>
                            <span class="text-danger">{{ _trans('common.When choose duty schedule its removed holiday') }}</span>
                        </div>
                        <div class="form-check d-none" id="weekendCheckboxContainer">
                            <input type="hidden" name="is_weekend" id="is_weekend" value="1">
                            <input type="checkbox" class="form-check-input" id="isWeekend" checked disabled>
                            <label class="form-check-label">{{ _trans('common.Weekend') }}</label> <br>
                            <span class="text-danger">{{ _trans('common.Selecting a Duty Schedule will remove the weekend assignment') }}</span>
                        </div>
                        <div class="form-check d-none" id="makeWeekend">
                            <input type="checkbox" class="form-check-input" name="make_weekend" id="make_weekend" value="1">
                            <label class="form-check-label">{{ _trans('common.Weekend') }}</label> <br>
                            <span class="text-danger">{{ _trans('common.If a weekend is assigned, the Duty Schedule will not be available for that day') }}</span>
                        </div>
                    </div>

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