<!-- Edit Payment Modal -->
<div class="modal fade" id="editPaymentModal" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">

    <?= form_open('admin/tokens/apply_payment', ['id' => 'editPaymentForm']) ?>
      
      <!-- CSRF -->
      <input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" 
             value="<?= $this->security->get_csrf_hash(); ?>" />
      <input type="hidden" name="id" value="<?= $tokenwithshift->id ?>" id="edit_id">

      <div class="modal-content">
        <!-- Modal Header -->
        <div class="modal-header bg-warning text-white">
          <h5 class="modal-title">Apply Payment</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
        </div>

        <!-- Modal Body -->
        <div class="modal-body">
<div class="row">
  <div class="col-md-6">
     <!-- Total Fee -->
          <div class="mb-3">
            <label for="edit_total_fee" class="form-label">Total Fee</label>
            <input type="text" class="form-control" id="edit_total_fee" name="total_fee" readonly>
          </div>
  </div>
  <div class="col-md-6">
     <!-- Paid Amount -->
          <div class="mb-3">
            <label for="edit_paid_so_far" class="form-label">Already Paid</label>
            <input type="text" class="form-control" id="edit_paid_so_far" name="paid_so_far" readonly>
          </div>
  </div>
</div>
<div class="row">
  <div class="col-md-6">
     <!-- Balance -->
          <div class="mb-3">
            <label for="edit_balance" class="form-label">Balance</label>
            <input type="text" class="form-control" id="edit_balance" name="balance" readonly>
          </div>
  </div>
  <div class="col-md-6">
     <!-- Amount patient is paying now -->
          <div class="mb-3">
            <label for="edit_paid_amount" class="form-label">Amount Paying Now</label>
            <input type="number" class="form-control" id="edit_paid_amount" name="paid_amount" min="0" step="0.01" required>
            <small class="text-muted">Cannot exceed current balance.</small>
          </div>
  </div>
</div>
         

         

         

         

        </div> <!-- modal-body -->

        <!-- Modal Footer -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
          <button type="submit" class="btn btn-primary">Apply Payment</button>
        </div>

      </div> <!-- modal-content -->

    <?= form_close(); ?>
  </div>
</div>
