<!-- Modal -->
<div class="modal fade" style="display:none;" id="paymentModal" tabindex="-1" aria-labelledby="paymentModalLabel" 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="paymentModalLabel">ชำระเงิน</h5>
            </div>
            <form action="{{ route('student.payment') }}"
                id="payFrm"
                novalidate class="{{ ($errors->any()) ? 'was-validated' : 'needs-validation' }}"
                method="post">
                @csrf
                <div class="modal-body">
                    <input type="hidden" name="payStudent" value="{{$student->title.$student->firstname ." ". $student->lastname}}">
                    <div class="row">
                        <div class="col-12">
                            <p><span class="font-weight-bold">ยอดค้างชำระ :</span> {{number_format( $student->course_cost - $student->discount - $student->paid)}} บาท</p>
                            <input type="hidden" value="{{  $student->course_cost - $student->discount - $student->paid }}" id="remain">
                            <input type="hidden" value="{{ $student->eid }}" name="eid">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-6">
                            <div class="form-group">
                                <label for="paymentMethod">รูปแบบการชำระเงิน <span class="text-red">*</span></label>
                                <select id="paymentMethod" name="paymentMethod" class="selectpicker show-menu-arrow form-control" title="--เลือก--" required>
                                    <option value="เงินสด">เงินสด</option>
                                    <option value="โอน">โอน</option>
                                    <option value="บัตรเครดิต">บัตรเครดิต</option>
                                </select>
                                @error('paymentMethod')
                                <div class="text-danger">{{  $message }}</div>
                                @enderror
                            </div>
                            {{-- <div class="form-group">
                                <label>รูปแบบการชำระเงิน <span class="text-red">*</span></label>
                                <div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input type="radio" id="cash" name="paymentMethod" value="เงินสด">
                                        <label for="cash">เงินสด</label>
                                    </div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input type="radio" id="transfer" name="paymentMethod" value="โอน">
                                        <label for="transfer">โอน</label>
                                    </div>
                                    <div class="icheck-nephritis icheck-inline">
                                        <input type="radio" id="credit" name="paymentMethod" value="บัตรเครดิต">
                                        <label for="credit">บัตรเครดิต</label>
                                    </div>
                                </div>
                                @error('paymentMethod')
                                <div class="text-danger">{{  $message }}</div>
                                @enderror
                            </div> --}}
                        </div>
                        <div class="col-6">
                            <div class="form-group">
                                <label for="pay">จำนวนที่ชำระ <span class="text-red">*</span></label>
                                <input type="number" class="form-control" id="pay" name="pay" placeholder="จำนวนที่ชำระ (บาท)" required>
                                @error('pay')
                                <div class="text-danger">{{  $message }}</div>
                                @enderror
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-6">
                            <div class="form-group">
                                <label for="payDate">วันที่ชำระ <span class="text-red">*</span></label>
                                <div class="input-group mb-3">
                                    <input type="text" class="form-control pay-date" id="payDate" name="payDate" 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('payDate')
                                <div class="text-danger">{{  $message }}</div>
                                @enderror
                            </div>
                        </div>
                        <div class="col-6">
                            <div class="form-group">
                                <label for="payTime" 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="payTime" name="payTime" placeholder="เวลา" autocomplete="off" required>
                                    <div class="input-group-append">
                                        <span class="input-group-text"><i class="far fa-clock"></i></span>
                                    </div>
                                </div>
                                @error('payTime')
                                <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="payBtn" class="btn btn-success">ชำระเงิน</button>
                </div>
            </form>
        </div>
    </div>
</div>
