<!-- Modal -->
<div class="modal fade" style="display:none;" id="addModuleModal" tabindex="-1" aria-labelledby="addModuleModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="addModuleModalLabel">เพิ่มรายวิชา</h5>
            </div>
            <form action="{{ route('course.add_module') }}"
                id="addModuleFrm"
                novalidate class="{{ ($errors->any()) ? 'was-validated' : 'needs-validation' }}"
                method="post">
                @csrf
                <div class="modal-body">
                    <input type="hidden" id="cid" name="cid" value="{{ $course->id }}">
                    <input type="hidden" id="logAddModule" name="logAddModule" value="{{ $course->name }}" >
                    <div class="row">
                        <div class="col-7">
                            <div class="form-group">
                                <label for="addModuleName">วิชา <span class="text-red">*</span></label>
                                <div class="input-group mb-3">
                                    <input type="text" class="form-control" id="addModuleName" name="addModuleName" placeholder="รายวิชา" autocomplete="off" required>
                                </div>
                                @error('addModuleName')
                                <div class="text-danger">{{  $message }}</div>
                                @enderror
                            </div>
                        </div>
                        <div class="col-2">
                            <div class="form-group">
                                <label for="add">จำนวนชั่วโมง <span class="text-red">*</span></label>
                                <div class="input-group mb-3">
                                    <input type="number" class="form-control" id="addModuleHour" name="addModuleHour" placeholder="จำนวนชั่วโมง" autocomplete="off" required>
                                </div>
                                @error('addModuleHour')
                                <div class="text-danger">{{  $message }}</div>
                                @enderror
                            </div>
                        </div>
                        <div class="col-3">
                            <div class="form-group">
                                <label for="addModuleDrive">มีการขับรถหรือไม่ <span class="text-red">*</span></label>
                                <div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input type="radio" id="ModuleDrive" name="addModuleDrive" value="ขับ" required>
                                        <label for="ModuleDrive">มี</label>
                                    </div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input type="radio" id="noModuleDrive" name="addModuleDrive" value="ไม่ขับ">
                                        <label for="noModuleDrive">ไม่มี</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">ปิด</button>
                    <button type="submit" id="addModuleBtn" class="btn btn-success">ตกลง</button>
                </div>
            </form>
        </div>
    </div>
</div>

