<!-- Modal -->
<div class="modal fade" id="withdrawModal{{$incomes[$i]['date']}}" tabindex="-1" aria-labelledby="withdrawModal{{$incomes[$i]['date']}}Label" aria-hidden="true" data-backdrop="static" >
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title-card" id="withdrawModal{{$incomes[$i]['date']}}Label">เบิกเงิน</h5>
            </div>
            <form action="{{ route('teacher.withdraw') }}"
                id="withdrawFrm"
                novalidate class="{{ ($errors->any()) ? 'was-validated' : 'needs-validation' }}"
                method="post">
                @csrf
                {{-- <input type="hidden" name="teacher" id="teacher" value="{{$income->teacher_id}}"> --}}
                <input type="hidden" name="teacher" id="teacher" value="{{$teacher->id}}">
                <input type="hidden" name="teacherName" value="{{$teacher->title.$teacher->firstname." ".$teacher->lastname}}">
                <input type="hidden" name="teachDate" id="teachDate" value="{{$incomes[$i]['date']}}">
                <input type="hidden" name="amount" id="amount" value="{{$incomes[$i]['total']}}">
            <div class="modal-body">
                <div class="row">
                    <div class="col-12">
                        <label >จำนวนเงิน : {{$incomes[$i]['total']}}</label>
                    </div>
                </div>
                <div class="row mt-2">
                    <div class="col-12">
                        <label >วันที่สอน : {{formatDateFromDB($incomes[$i]['date'])}}</label>
                    </div>
                </div>
                <div class="row mt-2">
                    <div class="col-12">
                        <div class="form-group">
                            <label>รูปแบบการจ่ายเงิน <span class="text-red">*</span></label>
                            <div>
                                <div class="icheck-nephritis icheck-inline">
                                    <input class="purpose" type="radio" id="cash" name="method" value="เงินสด" required>
                                    <label for="cash">เงินสด</label>
                                </div>
                                <div class="icheck-nephritis icheck-inline">
                                    <input class="purpose" type="radio" id="transfer" name="method" value="โอนผ่านบัญชี">
                                    <label for="transfer">โอนผ่านบัญชี</label>
                                </div>
                            </div>
                            @error('method')
                            <div class="text-danger">{{ $message }}</div>
                            @enderror
                        </div>
                    </div>
                </div>
                <div class="row mt-2">
                    <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" 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 class="modal-footer mt-2">
                <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>
<!-- End modal -->
