diff --git a/add_contact.php b/add_contact.php
new file mode 100644
index 0000000..dbb109e
--- /dev/null
+++ b/add_contact.php
@@ -0,0 +1,23 @@
+prepare("INSERT INTO contacts (name, email, phone) VALUES (?, ?, ?)");
+ $stmt->execute([$name, $email, $phone]);
+ } catch (PDOException $e) {
+ // In a real app, you'd log this error.
+ // For now, we'll just ignore it for this simple example.
+ }
+ }
+}
+
+header('Location: index.php');
+exit;
+?>
\ No newline at end of file
diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..4d0296e
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,15 @@
+body {
+ background-color: #F9FAFB;
+ font-family: 'Inter', sans-serif;
+}
+:root {
+ --primary-color: #4F46E5;
+ --secondary-color: #10B981;
+ --background-color: #F9FAFB;
+ --surface-color: #FFFFFF;
+ --text-color: #111827;
+}
+.btn-primary {
+ background-color: var(--primary-color);
+ border-color: var(--primary-color);
+}
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 0000000..9b82809
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,2 @@
+
+// This file can be used for custom JavaScript
diff --git a/index.php b/index.php
index 7205f3d..83a0ed8 100644
--- a/index.php
+++ b/index.php
@@ -4,147 +4,199 @@ declare(strict_types=1);
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
-$phpVersion = PHP_VERSION;
-$now = date('Y-m-d H:i:s');
+require_once 'db/config.php';
+
+// Create contacts table if it doesn't exist
+try {
+ $pdo = db();
+ $pdo->exec("CREATE TABLE IF NOT EXISTS contacts (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(255) NOT NULL,
+ email VARCHAR(255),
+ phone VARCHAR(50),
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+ )");
+} catch (PDOException $e) {
+ // In a real app, you'd log this error.
+ die("Could not connect to the database and create table.");
+}
+
+$contacts = [];
+try {
+ $pdo = db();
+ $stmt = $pdo->query("SELECT id, name, email, phone, created_at FROM contacts ORDER BY created_at DESC");
+ $contacts = $stmt->fetchAll(PDO::FETCH_ASSOC);
+} catch (PDOException $e) {
+ // In a real app, you'd log this error.
+}
+
+$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Optera CRM';
+$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
+
?>
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Optera CRM
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
Analyzing your requirements and generating your website…
-
- Loading…
-
-
= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-
This page will update automatically as the plan is implemented.
-
Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
+
+
+
+
+
+
Contacts
+
-
-
+
+
+
+
+
+
+ | Name |
+ Email |
+ Phone |
+ Created At |
+
+
+
+
+
+ |
+ No contacts yet.
+
+ |
+
+
+
+
+ | = htmlspecialchars($contact['name']) ?> |
+ = htmlspecialchars($contact['email']) ?> |
+ = htmlspecialchars($contact['phone']) ?> |
+ = htmlspecialchars((new DateTime($contact['created_at']))->format('M j, Y')) ?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+