:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/public_html/crm/**
:: Editing File: payment_details_list.php
<?php // ✅ Page title $page_title = "Clients Payments"; include 'header.php'; include 'breadcrumb.php'; include 'menu.php'; $result = mysqli_query($conn, "SELECT p.*, c.id as client_id, c.name AS client_name FROM payment_details p LEFT JOIN clients c ON c.id = p.clients_id ORDER BY p.id DESC"); ?> <div class="page-body"> <div class="container-fluid"> <div class="card"> <div class="card-header d-flex justify-content-between"> <h4>Payment Details List</h4> <a href="payment_details_add.php" class="btn btn-primary">+ Add Payment</a> <!--<a href="payment_details_add.php" class="btn btn-warning">+ Add Invoice Creation Process</a> --> </div> <div class="card-body"> <div class="dt-ext table-responsive"> <table class="display" id="export-button"> <thead> <tr> <th>ID</th> <th>Client</th> <th>Service</th> <th>Total Payment</th> <th>Received</th> <th>Remaining</th> <th>Date</th> <th>Invoice No</th> <!--<th>Status</th>--> <th>Action</th> </tr> </thead> <tbody> <?php while($row = mysqli_fetch_assoc($result)): $today = strtotime(date('Y-m-d')); $remaining_date = strtotime($row['payment_remaining_date']); $days_left = ($remaining_date - $today) / (60 * 60 * 24); if ($days_left <= 0 && $row['payment_remaining'] > 0) { $row_color = 'table-danger'; $status = 'Overdue'; } elseif ($days_left <= 30 && $row['payment_remaining'] > 0) { $row_color = 'table-warning'; $status = 'Due Soon'; } else { $row_color = 'table-success'; $status = 'Paid / Up-to-date'; } ?> <tr class="<?= $row_color ?>"> <td><?= $row['id'] ?></td> <td><?= htmlspecialchars($row['client_name']) ?></td> <td><?= htmlspecialchars($row['service_taken']) ?></td> <td>₹<?= number_format($row['payment'], 2) ?></td> <td>₹<?= number_format($row['payment_received'], 2) ?></td> <td>₹<?= number_format($row['payment_remaining'], 2) ?></td> <td><?= $row['payment_received_date'] ?></td> <td><?= $row['invoice_number'] ?></td> <!-- <td><strong><?= $status ?></strong></td>--> <td> <a href="payment_details_edit.php?id=<?= $row['id'] ?>" class='btn btn-warning btn-sm'> <i class='fa fa-edit'></i> Edit </a> <a href="payment_details_delete.php?id=<?= $row['id'] ?>" class='btn btn-danger btn-sm' onclick=\"return confirm('Are you sure you want to delete this client?');\"> <i class='fa fa-trash'></i> Delete </a> <?php /* if(empty($row['invoice_pdf'])) { ?> <a href="invoice_edit.php?client_id=<?= $row['client_id']; ?>&payment_id=<?= $row['id']; ?>" class="btn btn-sm btn-primary"> Generate Invoice </a> <?php } else { ?> <a href="<?= $row['invoice_pdf']; ?>" target="_blank" class="btn btn-sm btn-success"> Download Invoice </a> <?php } */ ?> </td> </tr> <?php endwhile; ?> </tbody> </table> </div> </div> </div> </div> </div> <?php include 'footer.php'; ?>