diff --git a/add_project.php b/add_project.php
new file mode 100644
index 0000000..867e2cf
--- /dev/null
+++ b/add_project.php
@@ -0,0 +1,34 @@
+prepare($sql);
+ $stmt->execute([$name, $client, $start_date]);
+ } catch (PDOException $e) {
+ // Proper error logging should be implemented
+ // For now, redirect with a generic error
+ header('Location: index.php?error=db');
+ exit;
+ }
+
+ header('Location: index.php?success=added');
+ exit;
+} else {
+ // If not a POST request, redirect home
+ header('Location: index.php');
+ exit;
+}
diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..5901bc6
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,115 @@
+/* ConstructApp Custom Styles */
+@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
+
+:root {
+ --primary-color: #4A90E2;
+ --secondary-color: #50E3C2;
+ --bg-color: #F4F8FA;
+ --surface-color: #FFFFFF;
+ --text-color: #242A30;
+ --border-radius: 12px;
+}
+
+body {
+ font-family: 'Poppins', sans-serif;
+ background-color: var(--bg-color);
+ color: var(--text-color);
+}
+
+.navbar {
+ background-color: var(--surface-color);
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+}
+
+.navbar-brand {
+ font-weight: 600;
+ color: var(--primary-color) !important;
+}
+
+.main-content {
+ padding-top: 2rem;
+ padding-bottom: 2rem;
+}
+
+.page-header {
+ margin-bottom: 2rem;
+}
+
+.page-header h1 {
+ font-weight: 700;
+}
+
+.card {
+ border: none;
+ border-radius: var(--border-radius);
+ box-shadow: 0 4px 12px rgba(0,0,0,0.08);
+}
+
+.table {
+ border-collapse: separate;
+ border-spacing: 0 10px;
+}
+
+.table thead th {
+ border: none;
+ font-weight: 600;
+ color: #90a4ae;
+ font-size: 0.9rem;
+ text-transform: uppercase;
+}
+
+.table tbody tr {
+ background-color: var(--surface-color);
+ box-shadow: 0 2px 5px rgba(0,0,0,0.05);
+ border-radius: var(--border-radius);
+}
+.table tbody td {
+ border: none;
+ vertical-align: middle;
+ padding: 1rem;
+}
+.table tbody tr:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 4px 10px rgba(0,0,0,0.08);
+ transition: all 0.2s ease-in-out;
+}
+
+.table .status {
+ padding: 0.25rem 0.75rem;
+ border-radius: 1rem;
+ font-size: 0.8rem;
+ font-weight: 500;
+}
+.status-in-progress { background-color: #e6f7ff; color: #1890ff; }
+.status-not-started { background-color: #fffbe6; color: #faad14; }
+.status-completed { background-color: #f6ffed; color: #52c41a; }
+
+
+.btn-primary {
+ background-color: var(--primary-color);
+ border-color: var(--primary-color);
+ border-radius: 8px;
+ padding: 0.75rem 1.5rem;
+ font-weight: 500;
+ transition: all 0.2s ease;
+}
+.btn-primary:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 4px 10px rgba(74, 144, 226, 0.4);
+}
+
+.modal-content {
+ border-radius: var(--border-radius);
+ border: none;
+}
+.modal-header {
+ border-bottom: none;
+}
+.form-control {
+ border-radius: 8px;
+ padding: 0.75rem 1rem;
+}
+.form-control:focus {
+ box-shadow: 0 0 0 0.25rem rgba(74, 144, 226, 0.25);
+ border-color: var(--primary-color);
+}
diff --git a/db/setup.php b/db/setup.php
new file mode 100644
index 0000000..c1f740e
--- /dev/null
+++ b/db/setup.php
@@ -0,0 +1,31 @@
+exec($sql);
+
+ // Add some sample data if the table is new
+ $stmt = $pdo->query("SELECT COUNT(*) FROM projects");
+ if ($stmt->fetchColumn() == 0) {
+ $pdo->exec("
+ INSERT INTO projects (name, client, start_date, status) VALUES
+ ('Downtown Office Tower', 'Big Corp Development', '2026-01-15', 'In Progress'),
+ ('Residential Complex "The Greens"', 'Urban Living Inc.', '2026-03-01', 'Not Started'),
+ ('Bridge Renovation Project', 'City Infrastructure Dept.', '2025-11-20', 'Completed');
+ ");
+ }
+
+ } catch (PDOException $e) {
+ // In a real app, you'd log this error. For now, we'll just die.
+ die("Database setup failed: " . $e->getMessage());
+ }
+}
diff --git a/index.php b/index.php
index 7205f3d..ba68772 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,159 @@
query("SELECT id, name, client, start_date, status FROM projects ORDER BY created_at DESC");
+ $projects = $stmt->fetchAll(PDO::FETCH_ASSOC);
+} catch (PDOException $e) {
+ // For a real app, log this error and show a friendly message.
+ $error_message = "Error fetching projects: " . $e->getMessage();
+}
+
+function getStatusClass($status) {
+ switch (strtolower($status)) {
+ case 'in progress':
+ return 'status-in-progress';
+ case 'completed':
+ return 'status-completed';
+ case 'not started':
+ default:
+ return 'status-not-started';
+ }
+}
?>
-
+
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Dashboard - ConstructApp
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
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) ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ Project added successfully!
+
+
+
+
+
+
+
+
+
+
+ | Project Name |
+ Client |
+ Start Date |
+ Status |
+ |
+
+
+
+
+
+ |
+ No projects yet. Click "Add New Project" to get started!
+ |
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
+