:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/public_html/crm/**
:: Editing File: domain_details_list.php
<?php include 'header.php'; $page_title = "Domain Details"; include 'breadcrumb.php'; include 'menu.php'; ?> <div class="page-body"> <div class="container-fluid"> <div class="card"> <div class="row"> <div class="col-sm-8"> <div class="card-header pb-0 card-no-border"> <h2>Domain Details</h2> </div> </div> <div class="col-sm-4 text-end"> <div class="card-header pb-0 card-no-border"> <a href="domain_details_add.php" class="btn btn-primary btn-sm"> <i class="fa fa-plus"></i> Add Domain </a> </div> </div> </div> <div class="card-body"> <div class="dt-ext table-responsive"> <table class="display" id="export-button"> <thead> <tr> <th>#</th> <th>Client Name</th> <th>Start Date</th> <th>Expiry Date</th> <th>Total Days</th> <th>Amount</th> <th>Domain</th> <th>Actions</th> </tr> </thead> <tbody> <?php $sql = "SELECT d.*, c.name AS client_name, c.email FROM domain_details d JOIN clients c ON d.client_id = c.id ORDER BY d.id DESC"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { $i = 1; while ($row = mysqli_fetch_assoc($result)) { $start_date = $row['start_date']; $expiry_date = $row['expiry_date']; // ✅ Calculate total days between start and expiry $date1 = new DateTime($start_date); $date2 = new DateTime($expiry_date); $diff = $date1->diff($date2); $total_days = $diff->days; // ✅ Highlight rows where days < 30 $row_style = ""; if ($total_days < 30) { $row_style = "style='background-color:#dc3545; color:white;'"; } echo "<tr {$row_style}> <td>{$i}</td> <td>{$row['client_name']}</td> <td>{$start_date}</td> <td>{$expiry_date}</td> <td>{$total_days} days</td> <td>₹{$row['amount']}</td> <td>{$row['notes']}</td> <td> <a href='domain_details_edit.php?id={$row['id']}' class='btn btn-warning btn-sm'> <i class='fa fa-edit'></i> </a> <a href='domain_details_delete.php?id={$row['id']}' class='btn btn-danger btn-sm' onclick=\"return confirm('Are you sure you want to delete this domain record?');\"> <i class='fa fa-trash'></i> </a> </td> </tr>"; $i++; } } else { echo "<tr><td colspan='8' class='text-center text-muted'>No domain details found.</td></tr>"; } ?> </tbody> </table> </div> </div> </div> </div> </div> <?php include 'footer.php'; ?>