📁 File Manager
Editing:
/home/wedigitalindia/public_html/demo.wedigitalindia.com/dcl-erp/invoice.php
<?php include_once("include/head.php"); ?> <div class="main-panel"> <div class="content-wrapper"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-md-3"> <h4 class="card-title">INVOICE LIST</h4> </div> <div class="col-md-9"> <a href="create-invoice.php" class="btn btn-primary" style="float: right; margin-bottom: 10px;">Create Invoice</a> </div> </div> <div class="row"> <div class="col-12"> <?php if (isset($_SESSION['success_message'])) { echo '<div class="alert alert-success">' . $_SESSION['success_message'] . '</div>'; unset($_SESSION['success_message']); } if (isset($_SESSION['error_message'])) { echo '<div class="alert alert-danger">' . $_SESSION['error_message'] . '</div>'; unset($_SESSION['error_message']); } $sqlOrders = "SELECT * FROM orders ORDER BY created_at DESC"; $resultOrders = mysqli_query($conn, $sqlOrders); ?> <div class="table-responsive"> <table id="order-listing" class="table"> <thead> <tr> <th>Invoice ID</th> <th>Client Name</th> <th>Phone</th> <th>Date</th> <th>Status</th> <th>Actions</th> </tr> </thead> <tbody> <?php if (mysqli_num_rows($resultOrders) > 0) { while ($order = mysqli_fetch_assoc($resultOrders)) { $invoiceId = $order['id']; $clientName = $order['client_name']; $phone = $order['phone']; $date = date('d-m-Y', strtotime($order['created_at'])); $status = $order['status']; $statusLabel = ''; if ($status === 'Sent') { $statusLabel = '<label class="badge badge-info">Sent</label>'; } else { $statusLabel = '<label class="badge badge-warning">Pending</label>'; } echo "<tr> <td>ORD-00$invoiceId</td> <td>$clientName</td> <td>$phone</td> <td>$date</td> <td>$statusLabel</td> <td> <a href='view-invoice.php?id=$invoiceId' class='btn btn-outline-info'>View</a> <a href='send-invoice.php?id=$invoiceId' class='btn btn-outline-primary'>Send</a> </td> </tr>"; } } else { echo "<tr><td colspan='6' class='text-center'>No orders found.</td></tr>"; } ?> </tbody> </table> </div> <?php mysqli_close($conn); ?> </div> </div> </div> </div> </div> </div> <?php include_once("include/footer.php"); ?> </body> </html>
Save
Cancel