<!-- Modal -->
<div class="modal fade teacherModal2" id="teacherModal2{{$vehicle->id.$w.$i}}" tabindex="-1" aria-labelledby="teacherModal2{{$vehicle->id.$w.$i}}Label" aria-hidden="true" data-backdrop="static" >
    <div class="modal-dialog modal-dialog-centered">

        @if(date('Y-m-d')==$week[$w])
            @if(numberOfStudent($arrValue2[$w][$vehicle->id][$i])==1) <!-- มีผู้เรียนแค่ 1 คนในช่วงเวลา -->
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title-card" id="teacherModal2{{$vehicle->id.$w.$i}}Label">ระบุผู้สอน</h5>
                </div>
                <div class="modal-body">
                    <div class="row mb-3">
                        <div class="col-12 ">
                            <label id="vehicle-name" class="modal-label-card float-left">{{$vehicle->type ." คันที่ : ".$vehicle->number . " , " . $vehicle->brand." ".$vehicle->model. " [ ".$vehicle->registration_class." ".$vehicle->registration_number." ]"}} @if($arrGear2[$w][$vehicle->id][$i]=='m') {{ "(ธรรมดา)" }} @else {{ "(ออโต้)" }} @endif</label>
                        </div>
                    </div>

                    <div class="row mt-2">
                        <div class="col-12 ">
                            <label id="student-name{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">ผู้เรียน : {{$arrValue2[$w][$vehicle->id][$i]}}</label>
                        </div>
                    </div>
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="module{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">วิชา : {{ $arrModule2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                    <div class="row mt-2">
                        <div class="col-12">
                            <label id="drive-time{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">เวลา : {{formatTimeFromDB($arrSchedule2[$w][$vehicle->id][$i]) . " ถึง " . getEndTimeFromHour($arrSchedule2[$w][$vehicle->id][$i], ($arrSpan2[$w][$vehicle->id][$i])/2 ) ." น."}}</label>
                        </div>
                    </div>
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="note{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">หมายเหตุ : {{ $arrStuNote2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                    <form action="{{ route('calendar.booking') }}"
                            name="teacherBookFrm2"
                            id="teacherBookFrm2{{$vehicle->id.$w.$i}}"
                            novalidate class="teacherBookFrm2 {{ ($errors->any()) ? 'was-validated' : 'needs-validation' }}"
                            method="post"
                    >
                    @csrf
                        <input type="hidden" name="vehicleBookingID" id="vehicle-booking{{$vehicle->id.$w.$i}}" value="{{$arrBooking2[$w][$vehicle->id][$i]}}">
                        <input type="hidden" name="purpose" value="เรียนและสอบ">
                        <div class="row mt-4">
                            <div class="col-12">
                                <div class="form-group">
                                    <input type="hidden" name="teacherSelected" class="teacherSelected" value="{{$arrTeacher2[$w][$vehicle->id][$i]}}">
                                    <label for="teacher{{$vehicle->id.$w.$i}}" class="modal-label-card float-left mb-2">ผู้สอน @if(date('Y-m-d')==$week[$w])<span class="text-red">*</span>@endif</label>
                                    <select id="teacher{{$vehicle->id.$w.$i}}" name="teacher" data-size="10" data-container="body" title="--เลือก--" class="selectpicker show-menu-arrow form-control teacher" required>
                                        @foreach ($teachers as $indexKey => $teacher)
                                        @if($teacher->type=='t' || $teacher->type=='a')
                                        <option value="{{ $teacher->id }}" @if($teacher->id == $arrTeacher2[$w][$vehicle->id][$i]) selected @endif>{{ $teacher->title.$teacher->firstname. " " .$teacher->lastname }}</option>
                                        @endif
                                        @endforeach
                                    </select>
                                    @error('teacher{{$vehicle->id.$w.$i}}')
                                    <div class="text-danger">{{ $message }}</div>
                                    @enderror
                                </div>
                            </div>
                        </div>
                        <div class="row teacherTypeDiv" @if(!$arrTeacherScan2[$w][$vehicle->id][$i])style="display: none;" @endif>
                            <div class="col-12">
                                <div class="form-group d-flex justify-content-start">
                                    <div class="icheck-inline">
                                        <label class="modal-label-card" >ครูสอนกับครูสแกน : </label>
                                    </div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input type="radio" id="sameTeacher{{$vehicle->id.$w.$i}}" name="teacherType" value="true" @if($arrTeacherScan2[$w][$vehicle->id][$i] == $arrTeacher2[$w][$vehicle->id][$i]) checked @endif required>
                                        <label class="modal-label-card" for="sameTeacher{{$vehicle->id.$w.$i}}">คนเดียวกัน</label>
                                    </div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input type="radio" id="noSameTeacher{{$vehicle->id.$w.$i}}" name="teacherType" value="false" @if($arrTeacherScan2[$w][$vehicle->id][$i] != $arrTeacher2[$w][$vehicle->id][$i]) checked @endif>
                                        <label class="modal-label-card" for="noSameTeacher{{$vehicle->id.$w.$i}}">คนละคนกัน</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row teacherScanDiv" @if(!$arrTeacherScan2[$w][$vehicle->id][$i] || $arrTeacherScan2[$w][$vehicle->id][$i]==$arrTeacher2[$w][$vehicle->id][$i])style="display: none;" @endif>
                            <div class="col-12">
                                <div class="form-group">
                                    <label for="teacherScan{{$vehicle->id.$w.$i}}" class="modal-label-card float-left mb-2">ผู้สอนสแกน @if(date('Y-m-d')==$week[$w])<span class="text-red">*</span>@endif</label>
                                    <select id="teacherScan{{$vehicle->id.$w.$i}}" name="teacherScan" data-size="10" data-container="body" title="--เลือก--" class="selectpicker show-menu-arrow form-control teacher-scan" required>
                                        @foreach ($teachers as $indexKey => $teacher)
                                            @if($teacher->type=='s' || $teacher->type=='a')
                                            <option value="{{ $teacher->id }}" @if($teacher->id == $arrTeacherScan2[$w][$vehicle->id][$i]) selected @endif>{{ $teacher->title.$teacher->firstname. " " .$teacher->lastname }}</option>
                                            @endif
                                        @endforeach
                                    </select>
                                    @error('teacherScan{{$vehicle->id.$w.$i}}')
                                    <div class="text-danger">{{ $message }}</div>
                                    @enderror
                                </div>
                            </div>
                        </div>
                    </div> <!-- modal-body -->
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">ปิด</button>
                    <button type="submit" id="bookBtn{{$vehicle->id.$w.$i}}" class="btn btn-success" onclick="document.getElementById('teacherBookFrm2{{$vehicle->id.$w.$i}}').submit();">ตกลง</button>
                    </form>
                        @if(check_cancel_booking($arrSchedule2[$w][$vehicle->id][$i])) <!--เวลาปัจจุบัน(ทำรายยกเลิกได้) ก่อนเรียน > 4 ชม. -->
                            <form action="{{ route('calendar.cancel_booking') }}"
                                method="post"
                                {{-- onsubmit="confirmalert(event, {{ $vehicle->id.$w.$i }}, 'ยกเลิกตารางเรียน')" --}}
                            >
                                @csrf
                                @method('DELETE')
                                <input type="hidden" name="vehicleBookingID" id="vehicle-cancle-booking{{$vehicle->id.$w.$i}}" value="{{$arrBooking2[$w][$vehicle->id][$i]}}">
                                <div class="clearfix float-right" >
                                    <button type="submit" id="cancelBtn{{$vehicle->id.$w.$i}}" class="btn btn-danger" >ยกเลิกนัด</button>
                                </div>
                            </form>
                        @endif
                </div>
            </div>
            @else   <!-- ผู้เรียนมากกว่า 1 คนในเวลาเดียวกัน -->
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title-card" id="teacherModal2{{$vehicle->id.$w.$i}}Label">ระบุผู้สอน</h5>
                </div>
                <div class="modal-body">
                    <div class="row mb-3">
                        <div class="col-12 ">
                            <label id="vehicle-name" class="modal-label-card float-left">{{$vehicle->type ." คันที่ : ".$vehicle->number . " , " . $vehicle->brand." ".$vehicle->model. " [ ".$vehicle->registration_class." ".$vehicle->registration_number." ]"}} @if($arrGear2[$w][$vehicle->id][$i]=='m') {{ "(ธรรมดา)" }} @else {{ "(ออโต้)" }} @endif</label>
                        </div>
                    </div>
                    @if(check_cancel_booking($arrSchedule2[$w][$vehicle->id][$i])) <!--เวลาปัจจุบัน(ทำรายยกเลิกได้) ก่อนเรียน > 4 ชม. -->
                        @for($n = 0; $n < numberOfStudent($arrValue2[$w][$vehicle->id][$i]); $n++)
                            <form id="frm{{$vehicle->id.$w.$i.$n}}"
                                action="{{ route('calendar.cancel_booking') }}"
                                method="post"
                                {{-- onsubmit="confirmalert(event, {{ $vehicle->id.$w.$i }}, 'ยกเลิกตารางเรียน')" --}}
                            >
                            @csrf
                            @method('DELETE')
                                <input type="hidden" name="date" id="date-booking{{$vehicle->id.$w.$i}}" value="{{$week[$w]}}">
                                <div class="row mt-2">
                                    <input type="hidden" name="vehicleBookingID" id="vehicle-booking{{$vehicle->id.$w.$i.$n}}" value="{{ getVehicleBookingAtN($arrBooking2[$w][$vehicle->id][$i], $n) }}">
                                    <div class="col-9">
                                        <label id="student-name{{$n}}" class="modal-label-card float-left">ผู้เรียน : {{ getStudentAtN($arrValue2[$w][$vehicle->id][$i], $n)}}</label>
                                    </div>
                                    @if(date('Y-m-d')<$week[$w])
                                    <div class="col-3">
                                        <button type="submit" id="cancelBtn{{$vehicle->id.$w.$i.$n}}" class="btn btn-sm btn-danger">ยกเลิกนัด</button>
                                    </div>
                                    @endif
                                </div>
                                <div class="row mt-2">
                                    <div class="col-12">
                                        <label id="note{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">หมายเหตุ : {{ $arrStuNote2[$w][$vehicle->id][$i] }}</label>
                                    </div>
                                </div>
                            </form>
                            <hr style="margin-top: -5px;"/>
                        @endfor
                    @else <!-- เลยเวลา 4 ชม. ไม่สามารถยกเลิกนัดได้ ทำได้แค่ book ผู้สอน -->
                        @for($n = 0; $n < numberOfStudent($arrValue2[$w][$vehicle->id][$i]); $n++)
                            <div class="row mt-2">
                                <div class="col-9">
                                    <label id="student-name{{$n}}" class="modal-label-card float-left">ผู้เรียน : {{ getStudentAtN($arrValue2[$w][$vehicle->id][$i], $n)}}</label>
                                </div>
                                <hr>
                            </div>
                        @endfor
                    @endif
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="module{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">วิชา : {{ $arrModule2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                    <div class="row mt-2">
                        <div class="col-12">
                            <label id="drive-time{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">เวลา : {{formatTimeFromDB($arrSchedule2[$w][$vehicle->id][$i]) . " ถึง " . getEndTimeFromHour($arrSchedule2[$w][$vehicle->id][$i], ($arrSpan2[$w][$vehicle->id][$i])/2 ) ." น."}}</label>
                        </div>
                    </div>
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="note{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">หมายเหตุ : {{ $arrStuNote2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                    <form action="{{ route('calendar.booking') }}"
                        id="teacherBookFrm22{{$vehicle->id.$w.$i}}"
                        novalidate class="teacherBookFrm {{ ($errors->any()) ? 'was-validated' : 'needs-validation' }}"
                        method="post">
                        @csrf
                        <input type="hidden" name="vehicleBookingID" id="vehicle-booking{{$vehicle->id.$w.$i}}" value="{{$arrBooking2[$w][$vehicle->id][$i]}}">
                        <input type="hidden" name="purpose" value="เรียนและสอบ">
                    <div class="row mt-4">
                        <div class="col-12">
                            <div class="form-group">
                                <label for="teacher" class="modal-label-card float-left mb-2">ผู้สอน @if(date('Y-m-d')==$week[$w])<span class="text-red">*</span>@endif</label>
                                <select id="teacher{{$vehicle->id.$w.$i}}" name="teacher" data-size="10" data-container="body" class="selectpicker show-menu-arrow form-control teacher-select" @if(date('Y-m-d')>$week[$w]) disabled @endif required>
                                    <option value="">--เลือก--</option>
                                    @foreach ($teachers as $indexKey => $teacher)
                                    <option value="{{ $teacher->id }}" @if($teacher->id == $arrTeacher2[$w][$vehicle->id][$i]) selected @endif>{{ $teacher->title.$teacher->firstname. " " .$teacher->lastname }}</option>
                                    @endforeach
                                </select>
                                @error('teacher{{$vehicle->id.$w.$i}}')
                                <div class="text-danger">{{ $message }}</div>
                                @enderror
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row teacherTypeDiv" @if(!$arrTeacherScan2[$w][$vehicle->id][$i])style="display: none;" @endif>
                    <div class="col-12">
                        <div class="form-group d-flex justify-content-start">
                            <div class="icheck-inline">
                                <label class="modal-label-card" >ครูสอนกับครูสแกน : </label>
                            </div>
                            <div class="icheck-nephritis icheck-inline">
                                <input type="radio" id="sameTeacher{{$vehicle->id.$w.$i}}" name="teacherType" value="true" @if($arrTeacherScan2[$w][$vehicle->id][$i] == $arrTeacher2[$w][$vehicle->id][$i]) checked @endif required>
                                <label class="modal-label-card" for="sameTeacher{{$vehicle->id.$w.$i}}">คนเดียวกัน</label>
                            </div>
                            <div class="icheck-nephritis icheck-inline">
                                <input type="radio" id="noSameTeacher{{$vehicle->id.$w.$i}}" name="teacherType" value="false" @if($arrTeacherScan2[$w][$vehicle->id][$i] != $arrTeacher2[$w][$vehicle->id][$i]) checked @endif>
                                <label class="modal-label-card" for="noSameTeacher{{$vehicle->id.$w.$i}}">คนละคนกัน</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row teacherScanDiv" @if(!$arrTeacherScan2[$w][$vehicle->id][$i] || $arrTeacherScan2[$w][$vehicle->id][$i]==$arrTeacher2[$w][$vehicle->id][$i])style="display: none;" @endif>
                    <div class="col-12">
                        <div class="form-group">
                            <label for="teacherScan{{$vehicle->id.$w.$i}}" class="modal-label-card float-left mb-2">ผู้สอนสแกน @if(date('Y-m-d')==$week[$w])<span class="text-red">*</span>@endif</label>
                            <select id="teacherScan{{$vehicle->id.$w.$i}}" name="teacherScan" data-size="10" data-container="body" title="--เลือก--" class="selectpicker show-menu-arrow form-control teacher-scan" required>
                                @foreach ($teachers as $indexKey => $teacher)
                                    @if($teacher->type=='s' || $teacher->type=='a')
                                    <option value="{{ $teacher->id }}" @if($teacher->id == $arrTeacherScan2[$w][$vehicle->id][$i]) selected @endif>{{ $teacher->title.$teacher->firstname. " " .$teacher->lastname }}</option>
                                    @endif
                                @endforeach
                            </select>
                            @error('teacherScan{{$vehicle->id.$w.$i}}')
                            <div class="text-danger">{{ $message }}</div>
                            @enderror
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">ปิด</button>
                    <button type="submit" id="bookBtn{{$vehicle->id.$w.$i}}" onclick="document.getElementById('teacherBookFrm22{{$vehicle->id.$w.$i}}').submit();" class="btn btn-success">ตกลง</button>
                </div>
                    </form>
            </div>
            @endif
        @elseif(date('Y-m-d') < $week[$w]) <!-- ถ้ายังไม่ถึงวันนัดให้ยกเลิกนัดได้อย่างเดียว -->
            @if(numberOfStudent($arrValue2[$w][$vehicle->id][$i])==1) <!-- มีผู้เรียนแค่ 1 คนในช่วงเวลา -->
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title-card" id="teacherModal2{{$vehicle->id.$w.$i}}Label">ยกเลิกตารางเรียน</h5>
                </div>
                <div class="modal-body">
                    <div class="row mb-3">
                        <div class="col-12 ">
                            <label id="vehicle-name" class="modal-label-card float-left">{{$vehicle->type ." คันที่ : ".$vehicle->number . " , " . $vehicle->brand." ".$vehicle->model. " [ ".$vehicle->registration_class." ".$vehicle->registration_number." ]"}} @if($arrGear2[$w][$vehicle->id][$i]=='m') {{ "(ธรรมดา)" }} @else {{ "(ออโต้)" }} @endif</label>
                        </div>
                    </div>
                    <div class="row mt-2">
                        <input type="hidden" name="vehicleBookingID" id="vehicle-booking{{$vehicle->id.$w.$i}}" value="{{$arrBooking2[$w][$vehicle->id][$i]}}">
                        <div class="col-12 ">
                            <label id="student-name{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">ผู้เรียน : {{$arrValue2[$w][$vehicle->id][$i]}}</label>
                        </div>
                    </div>
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="module{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">วิชา : {{ $arrModule2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                    <div class="row mt-2">
                        <div class="col-12">
                            <label id="drive-time{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">เวลา : {{formatTimeFromDB($arrSchedule2[$w][$vehicle->id][$i]) . " ถึง " . getEndTimeFromHour($arrSchedule2[$w][$vehicle->id][$i], ($arrSpan2[$w][$vehicle->id][$i])/2 ) ." น."}}</label>
                        </div>
                    </div>
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="note{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">หมายเหตุ : {{ $arrStuNote2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <form id="frm{{$vehicle->id.$w.$i}}"
                        action="{{ route('calendar.cancel_booking') }}"
                        method="post"
                        {{-- onsubmit="confirmalert(event, {{ $vehicle->id.$w.$i }}, 'ยกเลิกตารางเรียน')" --}}
                    >
                        @csrf
                        @method('DELETE')
                        <input type="hidden" name="date" id="date-booking{{$vehicle->id.$w.$i}}" value="{{$week[$w]}}">
                        <input type="hidden" name="vehicleBookingID" id="vehicle-booking{{$vehicle->id.$w.$i}}" value="{{$arrBooking2[$w][$vehicle->id][$i]}}">
                        <button type="button" class="btn btn-outline-secondary mr-2" data-dismiss="modal">ปิด</button>
                        <div class="clearfix float-right" >
                            <button type="submit" id="cancelBtn{{$vehicle->id.$w.$i}}" class="btn btn-danger" >ยกเลิกนัด</button>
                        </div>
                    </form>
                </div>
            </div>
            @else <!-- ผู้เรียนมากกว่า 1 คนในเวลาเดียวกัน -->
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title-card" id="teacherModal2{{$vehicle->id.$w.$i}}Label">ยกเลิกตารางเรียน</h5>
                </div>
                <div class="modal-body">
                    @for($n = 0; $n < numberOfStudent($arrValue2[$w][$vehicle->id][$i]); $n++)
                    <form id="frm{{$vehicle->id.$w.$i.$n}}"
                        action="{{ route('calendar.cancel_booking') }}"
                        method="post"
                        {{-- onsubmit="confirmalert(event, {{ $vehicle->id.$w.$i }}, 'ยกเลิกตารางเรียน')" --}}
                    >
                        @csrf
                        @method('DELETE')
                        <div class="row mt-3">
                            <input type="hidden" name="date" id="date-booking{{$vehicle->id.$w.$i}}" value="{{$week[$w]}}">
                            <input type="hidden" name="vehicleBookingID" id="vehicle-booking{{$vehicle->id.$w.$i.$n}}" value="{{ getVehicleBookingAtN($arrBooking2[$w][$vehicle->id][$i], $n) }}">
                            <div class="col-9">
                                <label id="student-name{{$n}}" class="modal-label-card float-left">ผู้เรียน : {{ getStudentAtN($arrValue2[$w][$vehicle->id][$i], $n)}}</label>
                            </div>
                            <div class="col-3">
                                <button type="submit" id="cancelBtn{{$vehicle->id.$w.$i.$n}}" class="btn btn-sm btn-danger" style="margin-top:-8px;">ยกเลิกนัด</button>
                            </div>
                        </div>
                        <div class="row mt-2">
                            <div class="col-12">
                                <label id="note{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">หมายเหตุ : {{ $arrStuNote2[$w][$vehicle->id][$i] }}</label>
                            </div>
                        </div>
                    </form>
                    <hr style="margin-top: -5px;"/>
                    @endfor
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="module{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">วิชา : {{ $arrModule2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                    <div class="row mt-2">
                        <div class="col-12">
                            <label id="drive-time{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">เวลา : {{formatTimeFromDB($arrSchedule2[$w][$vehicle->id][$i]) . " ถึง " . getEndTimeFromHour($arrSchedule2[$w][$vehicle->id][$i], ($arrSpan2[$w][$vehicle->id][$i])/2 ) ." น."}}</label>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">ปิด</button>
                </div>
            </div>
            @endif
        @else <!-- รายการของวันที่ผ่านมาแล้ว -->
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row mb-3">
                        <div class="col-12 ">
                            <label class="modal-label-card float-left">{{$vehicle->type ." คันที่ : ".$vehicle->number . " , " . $vehicle->brand." ".$vehicle->model. " [ ".$vehicle->registration_class." ".$vehicle->registration_number." ]"}} @if($arrGear2[$w][$vehicle->id][$i]=='m') {{ "(ธรรมดา)" }} @else {{ "(ออโต้)" }} @endif</label>
                        </div>
                    </div>
                    @if(numberOfStudent($arrValue2[$w][$vehicle->id][$i])==1) <!-- มีผู้เรียนแค่ 1 คนในช่วงเวลา -->
                        <div class="row mt-2">
                            <div class="col-12 ">
                                <label class="modal-label-card float-left">ผู้เรียน : {{$arrValue2[$w][$vehicle->id][$i]}}</label>
                            </div>
                        </div>
                        <div class="row mt-2">
                            <div class="col-12">
                                <label class="modal-label-card float-left">หมายเหตุ : {{ $arrStuNote2[$w][$vehicle->id][$i] }}</label>
                            </div>
                        </div>
                    @else
                        @for($n = 0; $n < numberOfStudent($arrValue2[$w][$vehicle->id][$i]); $n++)
                            <div class="row mt-2">
                                <div class="col-12">
                                    <label id="student-name{{$n}}" class="modal-label-card float-left">ผู้เรียน : {{ getStudentAtN($arrValue2[$w][$vehicle->id][$i], $n)}}</label>
                                </div>
                            </div>
                            <div class="row mt-2">
                                <div class="col-12">
                                    <label class="modal-label-card float-left">หมายเหตุ : {{ $arrStuNote2[$w][$vehicle->id][$i] }}</label>
                                </div>
                            </div>
                        @endfor
                    @endif
                    <div class="row mt-4">
                        <div class="col-12">
                            <label id="module{{$vehicle->id.$w.$i}}" class="modal-label-card float-left">วิชา : {{ $arrModule2[$w][$vehicle->id][$i] }}</label>
                        </div>
                    </div>
                    <div class="row mt-2">
                        <div class="col-12">
                            <label class="modal-label-card float-left">เวลา : {{formatTimeFromDB($arrSchedule2[$w][$vehicle->id][$i]) . " ถึง " . getEndTimeFromHour($arrSchedule2[$w][$vehicle->id][$i], ($arrSpan2[$w][$vehicle->id][$i])/2 ) ." น."}}</label>
                        </div>
                    </div>
                    <div class="row mt-4">
                        <div class="col-12">
                            <label class="modal-label-card float-left">ผู้สอน : {{ getTeacherName($teachers, $arrTeacher2[$w][$vehicle->id][$i])}}</label>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">ปิด</button>
                </div>
            </div>
        @endif
    </div>

</div>
<!-- End modal -->

