Файловый менеджер - Редактировать - /home/d46091/invoice.ecogenix.in/view_invoices.php
Назад
<?php // index.php - Home page showing recent invoices and summary require_once('includes/connection.php'); require_once('includes/header.php'); // Get total invoice count $sql = "SELECT COUNT(id) as total FROM challan_invoices"; $result = $conn->query($sql); $totalInvoices = 0; if ($result && $result->num_rows > 0) { $row = $result->fetch_assoc(); $totalInvoices = $row['total']; } // Get recent invoices $sql = "SELECT id, invoice_no, invoice_date, consignee_name FROM challan_invoices ORDER BY created_at DESC LIMIT 10"; $result = $conn->query($sql); ?> <div class="content"> <div style="display: flex; gap: 20px; margin-bottom: 30px;"> <div style="background-color: #f8f9fa; padding: 20px; border-radius: 5px; flex: 1; box-shadow: 0 2px 4px rgba(0,0,0,0.1);"> <h3>Total Invoices</h3> <p style="font-size: 24px; font-weight: bold;"><?php echo $totalInvoices; ?></p> </div> </div> <div style="margin-top: 30px;"> <div style="display: flex; justify-content: space-between; align-items: center;"> <h2>Recent Invoices</h2> <a href="challan.php" style="background-color:rgb(255, 0, 0); color: white; padding: 10px 15px; text-decoration: none; border-radius: 4px;">Back</a> </div> <?php if ($result && $result->num_rows > 0): ?> <table style="width: 100%; border-collapse: collapse; margin-top: 20px;"> <thead> <tr> <th style="border: 1px solid #ddd; padding: 10px; background-color: #f2f2f2; text-align: left;">Invoice No.</th> <th style="border: 1px solid #ddd; padding: 10px; background-color: #f2f2f2; text-align: left;">Date</th> <th style="border: 1px solid #ddd; padding: 10px; background-color: #f2f2f2; text-align: left;">Consignee</th> <th style="border: 1px solid #ddd; padding: 10px; background-color: #f2f2f2; text-align: left;">Actions</th> </tr> </thead> <tbody> <?php while ($row = $result->fetch_assoc()): ?> <tr> <td style="border: 1px solid #ddd; padding: 10px;"><?php echo htmlspecialchars($row['invoice_no']); ?></td> <td style="border: 1px solid #ddd; padding: 10px;"><?php echo htmlspecialchars($row['invoice_date']); ?></td> <td style="border: 1px solid #ddd; padding: 10px;"><?php echo htmlspecialchars($row['consignee_name']); ?></td> <td style="border: 1px solid #ddd; padding: 10px;"> <a href="print_challan_invoice.php?id=<?php echo $row['id']; ?>" class="btn btn-primary" style="margin-right: 10px;">View</a> <!-- <a href="edit_invoice.php?id=<?php echo $row['id']; ?>" style="color: #FFC107; margin-right: 10px;">Edit</a> --> <!-- <a href="delete_invoice.php?id=<?php echo $row['id']; ?>" class="btn btn-danger" style="margin-right: 10px;" onclick="return confirm('Are you sure you want to delete this invoice?')">Delete</a> --> </td> </tr> <?php endwhile; ?> </tbody> </table> <?php else: ?> <p>No invoices found. <a href="create_invoice.php">Create your first invoice</a>.</p> <?php endif; ?> </div> </div> <?php require_once('includes/footer.php'); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка