Customers
- -| # | +Name | +Status | +Registered | +Actions | +|
|---|---|---|---|---|---|
| No customers found. | +|||||
| + | + | + | + + + | ++ | + + + | +
| ID | -Name | -Plan | -Status | -Actions | -|
|---|---|---|---|---|---|
| No customers found. | -|||||
| CUST- | -- | - | - | - | - - - | -
diff --git a/customers.php b/customers.php index 0815e26..00dbd18 100644 --- a/customers.php +++ b/customers.php @@ -1,127 +1,81 @@ query('SELECT id, name, email, plan, status FROM customers ORDER BY id'); - $customers = $stmt->fetchAll(); + $stmt = $pdo->query('SELECT id, name, email, status, created_at FROM customers ORDER BY created_at DESC'); + $customers = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { - // For development, you might want to log this error or display a generic message - // For production, log the error and show a user-friendly message. - error_log('Database error: ' . $e->getMessage()); - $customers = []; // Ensure $customers is an empty array on error - // Optionally, set an error message to display to the user - $errorMessage = 'Could not retrieve customer data. Please try again later.'; -} - -function getStatusBadgeClass($status) { - switch (strtolower($status)) { - case 'active': - return 'bg-success'; - case 'suspended': - return 'bg-warning text-dark'; - case 'deactivated': - return 'bg-danger'; - default: - return 'bg-secondary'; - } + $customers = []; + $error_message = "Error: Could not fetch customer data."; } ?> - - -
- - -| # | +Name | +Status | +Registered | +Actions | +|
|---|---|---|---|---|---|
| No customers found. | +|||||
| + | + | + | + + + | ++ | + + + | +
| ID | -Name | -Plan | -Status | -Actions | -|
|---|---|---|---|---|---|
| No customers found. | -|||||
| CUST- | -- | - | - | - | - - - | -
Here's an overview of your billing status.
- - -1,234
$54,321
+$5,678
+92%
+The invoices management page is under construction.
+Please add subscription plans to see them here.
+The reports and analytics page is under construction.
+