<!-- Modal -->
<div class="modal fade" style="display:none;" id="courseModal" tabindex="-1" aria-labelledby="courseModalLabel" 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="courseModalLabel">เปลี่ยนคอร์สเรียน</h5>
                <div class="float-right"><span class="font-weight-bold">ยอดชำระไว้แล้ว :</span> <?php echo e(number_format($student->paid)); ?> บาท</div>
            </div>
            <form action="<?php echo e(route('student.course', $student->eid)); ?>"
                id="courseFrm"
                novalidate class="<?php echo e(($errors->any()) ? 'was-validated' : 'needs-validation'); ?>"
                method="post">
                <?php echo csrf_field(); ?>
                <div class="modal-body">
                    <input type="hidden" name="courseStudent" value="<?php echo e($student->title.$student->firstname ." ". $student->lastname); ?>">
                    <input type="hidden" id="paid" value="<?php echo e($student->paid); ?>">
                    <input type="hidden" id="currentCourse" value="<?php echo e($student->course_id); ?>">
                    <div class="row">
                        <div class="col-12">
                            <div class="form-group">
                                <label for="course">หลักสูตร <span class="text-red">*</span></label>
                                <select id="course" name="course" data-size="10" data-container="body" class="selectpicker show-menu-arrow form-control" required>
                                    <option value="">--เลือกหลักสูตร--</option>
                                    <?php $__currentLoopData = $courses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indexKey => $course): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($course->id."-". ($course->price + $course->optional_price)); ?>" <?php if($student->course_id == $course->id): ?> selected <?php endif; ?> ><?php echo e("[". $course->type ."] ". $course->name ." (".$course->gear.") , ราคา : ". number_format(($course->price + $course->optional_price), 0 , '.'    , ','   )." บาท"); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php $__errorArgs = ['course'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <div class="text-danger"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12 col-md-12">
                            <div class="form-group">
                                <label>รูปแบบการเรียน <span class="text-red">*</span></label>
                                <div class="text-center">
                                    <div class="icheck-nephritis icheck-inline">
                                        <input class="purpose" type="radio" id="driveOnly" name="purpose" value="เพิ่มประสบการณ์" <?php echo e(($student->purpose=="เพิ่มประสบการณ์")? "checked" : ""); ?> required>
                                        <label for="driveOnly">เพิ่มประสบการณ์</label>
                                    </div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input class="purpose" type="radio" id="driveTest" name="purpose" value="เรียนและสอบ" <?php echo e(($student->purpose=="เรียนและสอบ")? "checked" : ""); ?>>
                                        <label for="driveTest">เรียนและสอบ</label>
                                    </div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input class="purpose" type="radio" id="testOnly" name="purpose" value="เก็บชั่วโมงเพื่อสอบ" <?php echo e(($student->purpose=="เก็บชั่วโมงเพื่อสอบ")? "checked" : ""); ?>>
                                        <label for="testOnly">เก็บชั่วโมงเพื่อสอบ</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="newCourse" style="display: none;">
                        <div class="row" id="examDiv" style="display: none;">
                            <div class="col-6">
                                <div class="form-group">
                                    <label for="courseExamDate">วันที่อบรมกฎจราจรและสอบใบขับขี่ <span class="text-red">*</span></label>
                                    <div class="input-group mb-3">
                                        <input type="text" class="form-control datepiacker" id="courseExamDate" name="courseExamDate" placeholder="วันที่สอบ" autocomplete="off">
                                        <div class="input-group-append">
                                            <span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-6">
                                <div class="form-group">
                                    <label for="courseExamTime">เวลา <span class="text-red">*</span></label>
                                    <div class="input-group mb-3">
                                        <input type="text" class="form-control datepiacker" id="courseExamTime" name="courseExamTime" placeholder="เวลาที่สอบ" autocomplete="off">
                                        <div class="input-group-append">
                                            <span class="input-group-text"><i class="far fa-clock"></i></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <hr />
                        <div class="row">
                            <div class="col-sm-12 col-md-8">
                                <div class="form-group">
                                    <label for="discount">ส่วนลด (ถ้ามี)</label>
                                    <input type="text" class="form-control" id="discount" name="discount" placeholder="ข้อมูลส่วนลด">
                                </div>
                            </div>
                            <div class="col-sm-12 col-md-4">
                                <div class="form-group">
                                    <label for="discountAmount">จำนวนเงิน</label>
                                    <input type="text" class="form-control" id="discountAmount" name="discountAmount" placeholder="บาท">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-4">
                                <div class="form-group">
                                    <label for="totalCost">ยอดชำระ</label>
                                    <input type="text" class="form-control" id="totalCost" name="totalCost" disabled>
                                </div>
                            </div>
                            <div class="col-4">
                                <div class="form-group">
                                    <label for="coursePay">จำนวนที่ชำระ <span class="text-red">*</span></label>
                                    <input type="number" class="form-control" id="coursePay" name="coursePay" required>
                                    <?php $__errorArgs = ['coursePay'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-4">
                                <div class="form-group">
                                    <label for="courseRemain">คงเหลือต้องชำระ</label>
                                    <input type="text" class="form-control" id="courseRemain" name="courseRemain" disabled>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-4">
                                <div class="form-group">
                                    <label for="courseMethod">รูปแบบการชำระ <span class="text-red">*</span></label>
                                    <select id="courseMethod" name="courseMethod" class="selectpicker show-menu-arrow form-control" title="--เลือก--" required>
                                        <option value="เงินสด">เงินสด</option>
                                        <option value="โอน">โอนผ่านบัญชี</option>
                                        <option value="บัตรเครดิต">บัตรเครดิต</option>
                                    </select>
                                    <?php $__errorArgs = ['courseMethod'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-4">
                                <div class="form-group">
                                    <label for="coursePayDate" class="modal-label-card float-left mb-2">วันที่ชำระ <span class="text-red">*</span></label>
                                    <div class="input-group mb-3">
                                        <input type="text" class="form-control" id="coursePayDate" name="coursePayDate" placeholder="วันที่ชำระ" autocomplete="off" required>
                                        <div class="input-group-append">
                                            <span class="input-group-text"><i class="far fa-calendar-alt"></i></span>
                                        </div>
                                    </div>
                                    <?php $__errorArgs = ['coursePayDate'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                            </div>
                            <div class="col-4">
                                <div class="form-group">
                                    <label for="coursePayTime" class="modal-label-card float-left mb-2">เวลาที่ชำระ <span class="text-red">*</span></label>
                                    <div class="input-group mb-3">
                                        <input type="text" class="form-control" id="coursePayTime" name="coursePayTime" placeholder="เวลาที่ขำระ" autocomplete="off" required>
                                        <div class="input-group-append">
                                            <span class="input-group-text"><i class="far fa-clock"></i></span>
                                        </div>
                                    </div>
                                    <?php $__errorArgs = ['coursePayTime'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="text-danger"><?php echo e($message); ?></div>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </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="changeBtn" class="btn btn-success" style="display:none;">เปลี่ยนหลักสูตร</button>
                </div>
            </form>
        </div>
    </div>
</div>
<?php /**PATH /home/admin2/web/system.pongpetrdriving.com/public_html/resources/views/student/modal_course.blade.php ENDPATH**/ ?>