 <?php $__env->startSection('content'); ?>

<div class="card mb-3">
  <div class="card-header">
    <div class="row flex-between-end">
      <div class="col-auto align-self-center">
        
        <form class="form-material" method="POST" action="<?php echo e(url ('/search_payment')); ?>">
          <?php echo csrf_field(); ?>
          <input type="text" class="form-control" name="search" id="search">
          <br><button type="submit" class="btn btn-primary btn-sm" aria-placeholder="Search"><i class="fas fa-search"></i> Search</button>
           <br><br>
           <h5 class="mb-0" data-anchor="data-anchor">List of payments</h5>        
        </form>
      </div>
    </div>
  </div>
  <div class="card-body pt-0">

    <div id="tableExample2">
      <div class="table-responsive scrollbar">
        <small>
          <table id="basic-btn" class="table table-sm table-striped table-bordered nowrap">
            <thead class="bg-200 text-900">
              <tr>
                <th>ID</th>
                <th>Member ID</th>
                <th>Date</th>
                <th>Member Name</th>
                <th>Amount</th>
                <th>Payment Method</th>
                <th>Action</th>
              </tr>
            </thead>
            <tbody class="list">
              <?php $__currentLoopData = $payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $payment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <tr>
                <td><?php echo e($payment->id); ?></td>
                <td><?php echo e($payment->member_id); ?></td>
                <td><?php echo e($payment->payment_date); ?></td>
                <td><?php echo e($payment->member->name); ?></td>
                <td><?php echo e($payment->amount_paid); ?></td>
                <td><?php echo e($payment->mode->name); ?></td>
                <td>
                  <a href='<?php echo e(url("/receipt", $payment->id)); ?>' class="btn btn-primary btn-sm"> Print</a>&nbsp;
                  <a href='<?php echo e(url("/payment_edit", $payment->id)); ?>' onclick="return confirm('Are you sure you want to delete this payment?')" class="btn btn-sm btn-danger btn-outline-primary">Delete Request</a>
                  <?php if(Auth::user()->role == 3): ?> &nbsp;
                  <a href='<?php echo e(url("/delete_payment")); ?>/<?php echo e($payment->id); ?>/<?php echo e($payment->member_id); ?>' class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete this payment?')"> Delete </a>
                  <?php endif; ?>
                </td>
              </tr>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
          </table>
        </small>
      </div>
     
    </div>
  </div>

</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\WORK-STATION\MBBS\Insurance-Version Controls\03-01-2026\resources\views/payments/allpayments.blade.php ENDPATH**/ ?>