diff --git a/customers.php b/customers.php new file mode 100644 index 0000000..16440cb --- /dev/null +++ b/customers.php @@ -0,0 +1,144 @@ +prepare($sql); + $stmt->execute([$name, $email, $phone, $address]); + } catch (PDOException $e) { + die("Could not connect to the database $dbname :" . $e->getMessage()); + } +} + +// Create table if not exists +try { + $pdo = db(); + $sql = "CREATE TABLE IF NOT EXISTS customers ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + email VARCHAR(255) NOT NULL, + phone VARCHAR(255) NOT NULL, + address TEXT NOT NULL, + status VARCHAR(255) DEFAULT 'active', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + )"; + $pdo->exec($sql); +} catch (PDOException $e) { + die("Could not connect to the database $dbname :" . $e->getMessage()); +} + +// Fetch customers +try { + $pdo = db(); + $stmt = $pdo->query("SELECT * FROM customers ORDER BY created_at DESC"); + $customers = $stmt->fetchAll(PDO::FETCH_ASSOC); +} catch (PDOException $e) { + die("Could not connect to the database $dbname :" . $e->getMessage()); +} + +?> + + + + + + Customer Management + + + + + + +
+

Customer Management

+ +
+
+ Add New Customer +
+
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ +
+
+
+ +
+
+ Customer List +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDNameEmailPhoneAddressStatusCreated At
No customers found.
+
+
+
+
+ + + + diff --git a/index.php b/index.php index 7205f3d..852f6f6 100644 --- a/index.php +++ b/index.php @@ -12,7 +12,7 @@ $now = date('Y-m-d H:i:s'); - New Style + Billing Internet PPPoE - + @@ -32,119 +32,42 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; - - - - + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + +
+
+

Welcome to Billing Internet PPPoE

+

A simple and powerful application to manage your internet billing.

+
+

You can manage your customers, generate invoices, and much more.

+ Go to Customer Management +
-
- + + - + \ No newline at end of file