:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/crm/quatation/**
:: Editing File: design_details_list.php
<?php include 'header.php'; include 'menu.php'; include 'breadcrumb.php'; $result = mysqli_query($conn, "SELECT d.*, c.name AS client_name FROM design_details d LEFT JOIN clients c ON c.id = d.clients_id ORDER BY d.id DESC"); ?> <div class="page-body"> <div class="container-fluid"> <div class="card"> <div class="card-header d-flex justify-content-between"> <h4>Design Details List</h4> <a href="design_details_add.php" class="btn btn-primary">+ Add New</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>Start Date</th> <th>Expiry Date</th> <th>Service</th> <th>Amount</th> <th>Status</th> <th>Actions</th> </tr> </thead> <tbody> <?php while($row = mysqli_fetch_assoc($result)): $today = strtotime(date('Y-m-d')); $expiry = strtotime($row['expiry_date']); $days_left = ($expiry - $today) / (60 * 60 * 24); if ($days_left <= 0) { $row_color = 'table-danger'; $status = 'Expired'; } elseif ($days_left <= 30) { $row_color = 'table-warning'; $status = 'Expiring Soon'; } else { $row_color = ''; $status = 'Active'; } ?> <tr class="<?= $row_color ?>"> <td><?= $row['id'] ?></td> <td><?= htmlspecialchars($row['client_name']) ?></td> <td><?= $row['start_date'] ?></td> <td><?= $row['expiry_date'] ?></td> <td><?= $row['services'] ?></td> <td>₹<?= number_format($row['amount'], 2) ?></td> <td><strong><?= $status ?></strong></td> <td> <a href="design_details_edit.php?id=<?= $row['id'] ?>" class="btn btn-sm btn-info">Edit</a> <a href="design_details_delete.php?id=<?= $row['id'] ?>" class="btn btn-sm btn-danger" onclick="return confirm('Delete this record?')">Delete</a> </td> </tr> <?php endwhile; ?> </tbody> </table> </div> </div> </div> </div> </div> <?php include 'footer.php'; ?>