diff --git a/add_installation.php b/add_installation.php
new file mode 100644
index 0000000..7eb7700
--- /dev/null
+++ b/add_installation.php
@@ -0,0 +1,38 @@
+prepare(
+ "INSERT INTO installations (client_name, address, technician_name, observations, voltage, phase_neutral_ground, breaker_output) VALUES (?, ?, ?, ?, ?, ?, ?)"
+ );
+ $stmt->execute([$client_name, $address, $technician_name, $observations, $voltage, $phase_neutral_ground, $breaker_output]);
+
+ $_SESSION['message'] = 'Installation registered successfully!';
+ $_SESSION['message_type'] = 'success';
+ } catch (PDOException $e) {
+ error_log("Database error: " . $e->getMessage());
+ $_SESSION['message'] = 'Failed to register installation. Please try again.';
+ $_SESSION['message_type'] = 'danger';
+ }
+}
+
+header('Location: index.php');
+exit;
diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 0000000..1e1433f
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,131 @@
+@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
+
+:root {
+ --primary-color: #6cc24a;
+ --secondary-color: #2c3e50;
+ --sidebar-width: 280px;
+}
+
+body {
+ font-family: 'Poppins', sans-serif;
+ background-color: #f0f2f5;
+ color: #495057;
+}
+
+.sidebar {
+ position: fixed;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: var(--sidebar-width);
+ background-color: var(--secondary-color);
+ padding-top: 1rem;
+ transition: all 0.3s;
+}
+
+.sidebar .nav-link {
+ color: #adb5bd;
+ font-weight: 500;
+ padding: 0.75rem 1.5rem;
+ display: flex;
+ align-items: center;
+}
+
+.sidebar .nav-link i {
+ margin-right: 0.75rem;
+ font-size: 1.1rem;
+ width: 20px;
+ text-align: center;
+}
+
+.sidebar .nav-link:hover, .sidebar .nav-link.active {
+ color: #fff;
+ background-color: rgba(255, 255, 255, 0.05);
+}
+
+.sidebar .navbar-brand {
+ color: #fff !important;
+ font-weight: 700;
+ padding: 0.5rem 1.5rem;
+ font-size: 1.5rem;
+ margin-bottom: 1rem;
+}
+
+.main-content {
+ margin-left: var(--sidebar-width);
+ padding: 2rem;
+ transition: all 0.3s;
+}
+
+.top-navbar {
+ background-color: #fff;
+ border-radius: 0.5rem;
+ margin-bottom: 2rem;
+ padding: 0.75rem 1.5rem;
+ box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
+}
+
+.kpi-card {
+ border: none;
+ border-radius: 0.75rem;
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+ margin-bottom: 2rem;
+}
+
+.kpi-card .card-body {
+ display: flex;
+ align-items: center;
+}
+
+.kpi-card .kpi-icon {
+ font-size: 2.5rem;
+ padding: 1rem;
+ border-radius: 50%;
+ margin-right: 1.5rem;
+ color: #fff;
+}
+
+.kpi-card .kpi-value {
+ font-size: 2rem;
+ font-weight: 700;
+}
+
+.kpi-card .kpi-label {
+ font-weight: 500;
+ color: #6c757d;
+}
+
+.card {
+ border-radius: 0.75rem;
+ border: none;
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+}
+
+.btn-primary {
+ background-color: var(--primary-color);
+ border-color: var(--primary-color);
+ padding: 0.5rem 1.5rem;
+ font-weight: 600;
+}
+
+.btn-primary:hover {
+ background-color: #58a83a;
+ border-color: #58a83a;
+}
+
+.table thead th {
+ border-bottom: 2px solid #dee2e6;
+ font-weight: 600;
+}
+
+.table-hover tbody tr:hover {
+ background-color: #f8f9fa;
+}
+
+.modal-header {
+ border-bottom: none;
+}
+
+.modal-footer {
+ border-top: none;
+}
\ No newline at end of file
diff --git a/db/migrate.php b/db/migrate.php
new file mode 100644
index 0000000..ddfb7a3
--- /dev/null
+++ b/db/migrate.php
@@ -0,0 +1,12 @@
+exec($sql);
+ echo "Migration completed successfully.\n";
+} catch (PDOException $e) {
+ die("Migration failed: " . $e->getMessage() . "\n");
+}
+
diff --git a/db/migrations/001_create_installations_table.sql b/db/migrations/001_create_installations_table.sql
new file mode 100644
index 0000000..9c8d4aa
--- /dev/null
+++ b/db/migrations/001_create_installations_table.sql
@@ -0,0 +1,8 @@
+CREATE TABLE IF NOT EXISTS installations (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ client_name VARCHAR(255) NOT NULL,
+ address TEXT NOT NULL,
+ technician_name VARCHAR(255) NOT NULL,
+ observations TEXT,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
diff --git a/db/migrations/002_add_electrical_fields.sql b/db/migrations/002_add_electrical_fields.sql
new file mode 100644
index 0000000..fa399cf
--- /dev/null
+++ b/db/migrations/002_add_electrical_fields.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `installations`
+ADD COLUMN `voltage` VARCHAR(255) NULL,
+ADD COLUMN `phase_neutral_ground` VARCHAR(255) NULL,
+ADD COLUMN `breaker_output` VARCHAR(255) NULL;
diff --git a/index.php b/index.php
index 7205f3d..d2b590a 100644
--- a/index.php
+++ b/index.php
@@ -1,150 +1,262 @@
query("SELECT * FROM installations ORDER BY created_at DESC LIMIT 10");
+ $installations = $stmt->fetchAll(PDO::FETCH_ASSOC);
+ $total_installations = count($installations);
+} catch (Exception $e) {
+ $installations = [];
+ $total_installations = 0;
+ $db_error = "Database connection failed or table not found. Please run the migration.";
+}
?>
-
-
+
+
-
-
- New Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ ILOADNET SOLUTIONS - Dashboard
+
+
+
+
+
+
+
+
+
+
+
-
-
-
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) ?>
+
+
-
-
+
+
+
+
+
+
+
+
+
From your terminal, please run: php db/migrate.php
+
+
+
+
+
+
+
+
+
+
+
+
Dashboard
+
+
+
+
+
+
+
+
+
+
+
+
+
Total Installations
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Client |
+ Address |
+ Technician |
+ Date |
+ Actions |
+
+
+
+
+
+ | No installations found. |
+
+
+
+
+ |
+ |
+ |
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+