diff --git a/assets/css/custom.css b/assets/css/custom.css
index 93755df..d55c65e 100644
--- a/assets/css/custom.css
+++ b/assets/css/custom.css
@@ -1,8 +1,8 @@
-
+/* System Font Stack */
body {
- font-family: 'Poppins', sans-serif;
- background-color: #121212;
- color: #FFFFFF;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+ background-color: #f8f9fa;
+ color: #212529;
}
.sidebar {
@@ -10,52 +10,81 @@ body {
top: 0;
left: 0;
height: 100%;
- width: 250px;
- background-color: #1E1E1E;
+ width: 240px;
+ background-color: #ffffff;
+ border-right: 1px solid #e7e7e7;
padding: 1rem;
}
+.sidebar h4 {
+ color: #007bff;
+ font-weight: 700;
+}
+
.sidebar .nav-link {
- color: #A0A0A0;
- font-size: 1.1rem;
+ color: #6c757d;
+ font-size: 1rem;
margin-bottom: 0.5rem;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
- color: #FFFFFF;
+ color: #007bff;
}
.sidebar .nav-link .bi {
margin-right: 0.8rem;
+ font-size: 1.2rem;
}
.main-content {
- margin-left: 250px;
+ margin-left: 240px;
padding: 2rem;
}
.kpi-card {
- background-color: #1E1E1E;
- border: 1px solid #333;
+ background-color: #ffffff;
+ border: 1px solid #e7e7e7;
border-radius: 0.5rem;
padding: 1.5rem;
- color: #FFFFFF;
+ color: #212529;
+ transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
+}
+
+.kpi-card:hover {
+ box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
+ transform: translateY(-2px);
}
.kpi-card h5 {
- color: #A0A0A0;
- font-size: 1rem;
+ color: #6c757d;
+ font-size: 0.9rem;
text-transform: uppercase;
+ font-weight: 600;
margin-bottom: 1rem;
}
.kpi-card .value {
- font-size: 2.5rem;
- font-weight: 600;
+ font-size: 2.2rem;
+ font-weight: 700;
+ color: #212529;
}
.kpi-card .icon {
- font-size: 3rem;
+ font-size: 2.8rem;
color: #007bff;
- opacity: 0.5;
+ opacity: 0.2;
}
+
+.card {
+ border: 1px solid #e7e7e7;
+ box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
+}
+
+.table {
+ color: #212529;
+}
+
+.table thead th {
+ font-weight: 600;
+ color: #495057;
+}
\ No newline at end of file
diff --git a/customers.php b/customers.php
new file mode 100644
index 0000000..0815e26
--- /dev/null
+++ b/customers.php
@@ -0,0 +1,127 @@
+query('SELECT id, name, email, plan, status FROM customers ORDER BY id');
+ $customers = $stmt->fetchAll();
+} 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 - CableCRM
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Customers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ID |
+ Name |
+ Email |
+ Plan |
+ Status |
+ Actions |
+
+
+
+
+
+ | No customers found. |
+
+
+
+
+ | CUST- |
+ |
+ |
+ |
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/db/migrate.php b/db/migrate.php
new file mode 100644
index 0000000..68baaba
--- /dev/null
+++ b/db/migrate.php
@@ -0,0 +1,31 @@
+exec($sql);
+ echo "Success.\n";
+ } catch (PDOException $e) {
+ echo "Error running migration " . basename($file) . ": " . $e->getMessage() . "\n";
+ // Exit on first error
+ exit(1);
+ }
+ }
+}
+
+run_migrations();
+
diff --git a/db/migrations/001_create_customers_table.sql b/db/migrations/001_create_customers_table.sql
new file mode 100644
index 0000000..0319ca7
--- /dev/null
+++ b/db/migrations/001_create_customers_table.sql
@@ -0,0 +1,9 @@
+CREATE TABLE IF NOT EXISTS `customers` (
+ `id` INT AUTO_INCREMENT PRIMARY KEY,
+ `name` VARCHAR(255) NOT NULL,
+ `email` VARCHAR(255) NOT NULL UNIQUE,
+ `plan` VARCHAR(100),
+ `status` VARCHAR(50) DEFAULT 'active',
+ `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/db/seed.php b/db/seed.php
new file mode 100644
index 0000000..4fecf77
--- /dev/null
+++ b/db/seed.php
@@ -0,0 +1,27 @@
+ 'John Doe', 'email' => 'john.doe@example.com', 'plan' => 'Premium HD', 'status' => 'Active'],
+ ['name' => 'Jane Smith', 'email' => 'jane.smith@example.com', 'plan' => 'Basic', 'status' => 'Active'],
+ ['name' => 'Mike Johnson', 'email' => 'mike.j@example.com', 'plan' => 'Premium HD', 'status' => 'Suspended'],
+ ['name' => 'Sarah Williams', 'email' => 'sarah.w@example.com', 'plan' => 'Family Pack', 'status' => 'Deactivated'],
+ ];
+
+ $stmt = $pdo->prepare("INSERT INTO customers (name, email, plan, status) VALUES (:name, :email, :plan, :status) ON DUPLICATE KEY UPDATE name=VALUES(name), plan=VALUES(plan), status=VALUES(status)");
+
+ foreach ($customers as $customer) {
+ echo "Seeding customer: " . $customer['name'] . "...\n";
+ try {
+ $stmt->execute($customer);
+ echo "Success.\n";
+ } catch (PDOException $e) {
+ echo "Error seeding customer " . $customer['name'] . ": " . $e->getMessage() . "\n";
+ }
+ }
+}
+
+seed_customers();
+
diff --git a/index.php b/index.php
index ebb5a9f..af81817 100644
--- a/index.php
+++ b/index.php
@@ -16,23 +16,19 @@
-
-
-
-