From a43964654450ad476be5aa9692a6ac27612ace09 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Wed, 31 Dec 2025 13:22:27 +0000 Subject: [PATCH] MAKTRAK V1.0 --- assets/css/custom.css | 77 +++++++++++++++++++++ dashboard.php | 58 ++++++++++++++++ db_setup.php | 76 +++++++++++++++++++++ index.php | 155 ++---------------------------------------- templates/footer.php | 4 ++ templates/header.php | 15 ++++ templates/sidebar.php | 53 +++++++++++++++ 7 files changed, 288 insertions(+), 150 deletions(-) create mode 100644 assets/css/custom.css create mode 100644 dashboard.php create mode 100644 db_setup.php create mode 100644 templates/footer.php create mode 100644 templates/header.php create mode 100644 templates/sidebar.php diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..3b6f8a3 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,77 @@ +body { + font-family: 'Roboto', sans-serif; + background-color: #f8f9fa; +} + +.sidebar { + width: 280px; + height: 100vh; + position: sticky; + top: 0; + background-color: #fff; + border-right: 1px solid #dee2e6; +} + +.sidebar .nav-link { + color: #333; + font-weight: 500; + margin: 5px 0; + border-radius: .25rem; +} + +.sidebar .nav-link.active, +.sidebar .nav-link:hover { + color: #0d6efd; + background-color: #e9ecef; +} + +.sidebar .nav-link .bi { + margin-right: 10px; +} + +.content { + flex-grow: 1; + padding: 2rem; +} + +.stat-card { + border: none; + border-radius: .5rem; + box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .075); + transition: transform 0.2s ease-in-out; +} + +.stat-card:hover { + transform: translateY(-5px); +} + +.stat-card .card-body { + display: flex; + align-items: center; +} + +.stat-card .icon-circle { + width: 60px; + height: 60px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + margin-right: 1.5rem; + font-size: 1.75rem; +} + +.bg-primary-soft { + background-color: rgba(13, 110, 253, 0.1); + color: #0d6efd; +} + +.bg-success-soft { + background-color: rgba(25, 135, 84, 0.1); + color: #198754; +} + +.bg-warning-soft { + background-color: rgba(255, 193, 7, 0.1); + color: #ffc107; +} diff --git a/dashboard.php b/dashboard.php new file mode 100644 index 0000000..6d04ce4 --- /dev/null +++ b/dashboard.php @@ -0,0 +1,58 @@ +
+

Dashboard

+
+ +
+
+
+
+ +
+
+
Current Stock
+

0 Liters

+
+
+
+
+ + +
+
+
+
+ +
+
+
Total Received
+

0 Liters

+
+
+
+
+ + +
+
+
+
+ +
+
+
Total Issued
+

0 Liters

+
+
+
+
+
+ +
+
+
Recent Activity
+
+
+

No recent fuel movements. Start by adding a fuel receipt or issuing fuel.

+
+
+
\ No newline at end of file diff --git a/db_setup.php b/db_setup.php new file mode 100644 index 0000000..c0a2252 --- /dev/null +++ b/db_setup.php @@ -0,0 +1,76 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + $sql = " + CREATE TABLE IF NOT EXISTS equipment ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + description TEXT, + is_active BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) ENGINE=INNODB; + + CREATE TABLE IF NOT EXISTS operators ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + is_active BOOLEAN NOT NULL DEFAULT TRUE, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) ENGINE=INNODB; + + CREATE TABLE IF NOT EXISTS locations ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + address TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) ENGINE=INNODB; + + CREATE TABLE IF NOT EXISTS fuel_receipts ( + id INT AUTO_INCREMENT PRIMARY KEY, + receipt_date DATE NOT NULL, + quantity DECIMAL(10, 2) NOT NULL, + supplier VARCHAR(255), + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) ENGINE=INNODB; + + CREATE TABLE IF NOT EXISTS fuel_issues ( + id INT AUTO_INCREMENT PRIMARY KEY, + issue_date DATE NOT NULL, + equipment_id INT NOT NULL, + operator_id INT NOT NULL, + location_id INT NOT NULL, + quantity DECIMAL(10, 2) NOT NULL, + notes TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (equipment_id) REFERENCES equipment(id) ON DELETE RESTRICT, + FOREIGN KEY (operator_id) REFERENCES operators(id) ON DELETE RESTRICT, + FOREIGN KEY (location_id) REFERENCES locations(id) ON DELETE RESTRICT + ) ENGINE=INNODB; + + CREATE TABLE IF NOT EXISTS users ( + id INT AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(50) NOT NULL UNIQUE, + password_hash VARCHAR(255) NOT NULL, + role ENUM('admin', 'user') NOT NULL DEFAULT 'user', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) ENGINE=INNODB; + "; + + $pdo->exec($sql); + + echo "
"; + echo "Success! Database tables created successfully."; + echo "

Go to Dashboard"; + echo "
"; + +} catch (PDOException $e) { + echo "
"; + die("Error: Could not create tables. " . $e->getMessage()); + echo "
"; +} diff --git a/index.php b/index.php index 7205f3d..9fc037c 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,5 @@ - - - - - - - New Style - - - - - - - - - - - - - - - - - - - - - -
-
-

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

-
-
- - - + + + + diff --git a/templates/header.php b/templates/header.php new file mode 100644 index 0000000..a2e5201 --- /dev/null +++ b/templates/header.php @@ -0,0 +1,15 @@ + + + + + + <?php echo htmlspecialchars(getenv('PROJECT_NAME') ?: 'Fuel Control'); ?> + + + + + + + + +
diff --git a/templates/sidebar.php b/templates/sidebar.php new file mode 100644 index 0000000..24ad578 --- /dev/null +++ b/templates/sidebar.php @@ -0,0 +1,53 @@ + \ No newline at end of file