<!-- Modal -->
<div class="modal fade" style="display:none;" id="examDateModal" tabindex="-1" aria-labelledby="examDateModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="examDateModalLabel">เลื่อนวันที่อบรมและสอบใบขับขี่</h5>
            </div>
            <form action="{{ route('student.exam', $student->eid) }}"
                id="examFrm"
                novalidate class="{{ ($errors->any()) ? 'was-validated' : 'needs-validation' }}"
                method="post">
                @csrf
                @method('PUT')
            <div class="modal-body">
                <input type="hidden" id="logStudentExam" name="logStudent" value="{{ $student->title.strip_tags($student->firstname)." ".strip_tags($student->lastname) }}" >
                <div class="row">
                    <div class="col-6">
                        <div class="form-group">
                            <label for="examDate">วันที่อบรมและสอบใบขับขี่ <span class="text-red">*</span></label>
                            <div class="input-group mb-3">
                                <input type="text" class="form-control" @if($student->exam_date != "") value="{{ formatDateFromDB($student->exam_date) }}" @endif id="examDate" name="examDate" placeholder="วันที่อบรมและสอบใบขับขี่" autocomplete="off" required>
                                <div class="input-group-append"><span class="input-group-text"><i class="far fa-calendar-alt"></i></span></div>
                            </div>
                            @error('examDate')
                            <div class="text-danger">{{  $message }}</div>
                            @enderror
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="form-group">
                            <label for="examDate">เวลา <span class="text-red">*</span></label>
                            <div class="input-group mb-3">
                                <input type="text" class="form-control" @if($student->exam_time != "") value="{{ $student->exam_time }}" @endif id="examTime" name="examTime" placeholder="เวลาที่อบรมและสอบใบขับขี่" autocomplete="off" required>
                                <div class="input-group-append"><span class="input-group-text"><i class="far fa-clock"></i></span></div>
                            </div>
                            @error('examDate')
                            <div class="text-danger">{{  $message }}</div>
                            @enderror
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">ปิด</button>
                <button type="submit" id="payBtnExam" class="btn btn-success">ตกลง</button>
            </div>
            </form>
        </div>
    </div>
</div>
