Файловый менеджер - Редактировать - /home/d46091/invoice.ecogenix.in/invoice.php
Назад
<?php // index.php - Home page showing recent invoices and summary require_once('includes/connection.php'); // Get total invoice count $sql = "SELECT COUNT(id) as total FROM invoices"; $result = $conn->query($sql); $totalInvoices = 0; if ($result && $result->num_rows > 0) { $row = $result->fetch_assoc(); $totalInvoices = $row['total']; } // Get total amount of all invoices $sql = "SELECT SUM(total_amount) as total_sum FROM invoices"; $result = $conn->query($sql); $totalAmount = 0; if ($result && $result->num_rows > 0) { $row = $result->fetch_assoc(); $totalAmount = $row['total_sum']; } // Get recent invoices $sql = "SELECT id, invoice_no, invoice_date, consignee_name, total_amount FROM invoices ORDER BY created_at DESC LIMIT 10"; $result = $conn->query($sql); require_once('includes/header.php'); ?> <div class="content"> <nav class="navbar navbar-expand-lg navbar-light bg-light mb-4"> <div class="container-fluid"> <button id="sidebarToggle" class="btn btn-outline-secondary d-md-none mr-auto"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand d-md-none" href="#">ECOGENIX</a> <div class="d-flex"> <!-- <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"> --> <!-- <button class="btn btn-outline-success" type="submit">Search</button> --> </div> </div> </nav> <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 style="background-color: #f8f9fa; padding: 20px; border-radius: 5px; flex: 1; box-shadow: 0 2px 4px rgba(0,0,0,0.1);"> <h3>Total Amount</h3> <p style="font-size: 24px; font-weight: bold;">₹ <?php echo number_format($totalAmount, 2); ?></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="create_invoice.php" style="background-color: #4CAF50; color: white; padding: 10px 15px; text-decoration: none; border-radius: 4px;">Create New Invoice</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;">Amount</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;">₹ <?php echo number_format($row['total_amount'], 2); ?></td> <td style="border: 1px solid #ddd; padding: 10px;"> <a href="print_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
|
Настройка