<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title"> ٹرپ #
        <span class="badge" id="addAdvanceInTripNo">{{ $trip->id }}</span>
        گاڑی :
        <span class="badge badge-color2" id="addAdvanceInTripVeh">{{ $trip->vehicle->vehicle_no }}</span>
        تاریخ:
        <span class="badge badge-color3" id="addAdvanceInTripDates">{{ date('F j, Y') }}</span>
        میں ایڈوانس
    </h4>
</div>
<div class="modal-body">
    <form  id="addAdvanceInTripForm">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label for="adv_amount">رقم<span class="text-danger">*</span></label>
                    <input type="number" min="1" id="adv_amount" name="adv_amount" class="form-control change_focus" data-id="adv_date">
                    <span class="text-danger advance_error" id="adv_amount_error"></span>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label for="adv_date">تاریخ<span class="text-danger">*</span></label>
                    <input type="date" id="adv_date" name="adv_date" class="form-control change_focus" data-id="adv_note"
                        value="{{ date('Y-m-d') }}">
                    <span class="text-danger advance_error" id="adv_date_error"></span>

                </div>
            </div>
            <div class="col-md-12">
                <div class="form-group">
                    <label for="adv_note">نوٹ</label>
                    <textarea id="adv_note" name="adv_note" class="form-control"></textarea>
                </div>
            </div>
        </div>
        @csrf
        <input type="hidden" name="trip_id" id="advance_trip_id" value="{{ $trip->id }}">
        <button type="submit" class="btn btn-success" name="addAdvanceInTripSubmit" id="addAdvanceInTripSubmit">
            مخفوظ
        </button>
    </form>
    <hr>
    <table class="table table-bordered" id="advance-payment-details-table">
        <thead>
            <tr class="bg-primary">
                <th>رقم</th>
                <th>تاریخ</th>
                <th>نوٹ</th>
            </tr>
        </thead>
        <tbody>
            @forelse ($advances as $advance)
                <tr>
                    <td>{{ number_format($advance->amount, 0) }}</td>
                    <td>{{ date('F j, Y', strtotime($advance->date)) }}</td>
                    <td>{{ $advance->note }}</td>
                </tr>
            @empty
                <tr>
                    <td colspan="3"> No Data Available</td>
                </tr>
            @endforelse
        </tbody>
    </table>

</div>
