From 13560e83a1c1ce6f24cd10e1102ee0618e175c0a Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 8 Nov 2025 10:31:44 +0000 Subject: [PATCH] Revert to version bab7166 --- assets/css/custom.css | 291 ++++++++++++++++++++++++++++++++++++++++++ assets/js/main.js | 48 +++++++ billing.php | 16 +++ customers.php | 16 +++ drivers.php | 16 +++ includes/footer.php | 6 + includes/header.php | 29 +++++ includes/sidebar.php | 44 +++++++ index.php | 186 ++++++--------------------- loads.php | 127 ++++++++++++++++++ maintenance.php | 16 +++ settings.php | 16 +++ 12 files changed, 662 insertions(+), 149 deletions(-) create mode 100644 assets/css/custom.css create mode 100644 assets/js/main.js create mode 100644 billing.php create mode 100644 customers.php create mode 100644 drivers.php create mode 100644 includes/footer.php create mode 100644 includes/header.php create mode 100644 includes/sidebar.php create mode 100644 loads.php create mode 100644 maintenance.php create mode 100644 settings.php diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..b16900a --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,291 @@ +/* assets/css/custom.css */ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); + +:root { + --color-background-light: #FDFBF5; /* Lighter Beige */ + --color-surface-light: #FFFFFF; + --color-text-light: #1C1C1C; /* Near Black */ + --color-primary: #B8860B; /* DarkGoldenRod - more subtle than pure gold */ + --color-secondary: #A9A9A9; /* DarkGray */ + --color-accent: #D4AF37; /* Golden */ + --border-color: #EAEAEA; + --border-radius: 0.5rem; + --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; +} + +body { + font-family: var(--font-family-sans-serif); + background-color: var(--color-background-light); + color: var(--color-text-light); + display: flex; + min-height: 100vh; +} + +.sidebar { + width: 260px; + background-color: var(--color-surface-light); + border-right: 1px solid var(--border-color); + padding: 1.5rem; + display: flex; + flex-direction: column; + flex-shrink: 0; +} + +.sidebar .logo { + font-size: 1.5rem; + font-weight: 700; + color: var(--color-primary); + margin-bottom: 2rem; + text-align: center; +} + +.sidebar .nav-link { + color: #555; + display: flex; + align-items: center; + padding: 0.75rem 1rem; + border-radius: var(--border-radius); + margin-bottom: 0.5rem; + transition: background-color 0.2s, color 0.2s; +} + +.sidebar .nav-link .feather { + margin-right: 1rem; + width: 20px; + height: 20px; +} + +.sidebar .nav-link:hover, +.sidebar .nav-link.active { + background-color: var(--color-accent); + color: var(--color-surface-light); +} + +.main-content { + flex-grow: 1; + padding: 2rem; + display: flex; + flex-direction: column; +} + +.header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 2rem; +} + +.header h1 { + font-size: 2rem; + font-weight: 600; +} + +.theme-toggle { + background: none; + border: 1px solid var(--border-color); + border-radius: 50%; + width: 40px; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + color: var(--color-secondary); +} + +.dashboard-cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 1.5rem; +} + +.card { + background-color: var(--color-surface-light); + border: 1px solid var(--border-color); + border-radius: var(--border-radius); + padding: 1.5rem; +} + +.card-title { + font-size: 0.9rem; + font-weight: 500; + color: var(--color-secondary); + margin-bottom: 0.5rem; +} + +.card-value { + font-size: 2rem; + font-weight: 600; + color: var(--color-text-light); +} + +.card-delta { + font-size: 0.85rem; + margin-top: 0.5rem; +} + +.text-success { + color: #28a745; +} + +.text-danger { + color: #dc3545; +} + +/* Dark Mode */ +body.dark-mode { + --color-background-light: #121212; + --color-surface-light: #1E1E1E; + --color-text-light: #E0E0E0; + --border-color: #333; + --color-secondary: #888; +} + +body.dark-mode .sidebar { + background-color: var(--color-surface-light); + border-right-color: var(--border-color); +} + +body.dark-mode .sidebar .nav-link { + color: #aaa; +} + +body.dark-mode .sidebar .nav-link:hover, +body.dark-mode .sidebar .nav-link.active { + background-color: var(--color-accent); + color: #121212; +} + +body.dark-mode .theme-toggle { + border-color: var(--border-color); + color: var(--color-secondary); +} + +body.dark-mode .card { + background-color: var(--color-surface-light); + border-color: var(--border-color); +} + +/* Page Content Sections */ +.content-section { + margin-bottom: 2rem; +} + +.content-section h2 { + font-size: 1.5rem; + font-weight: 600; + margin-bottom: 1rem; +} + +/* Form Styles */ +.form-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + gap: 1rem; +} + +.form-group { + display: flex; + flex-direction: column; +} + +.form-group-full { + grid-column: 1 / -1; +} + +.form-group label { + font-size: 0.875rem; + font-weight: 500; + margin-bottom: 0.5rem; + color: var(--color-secondary); +} + +.form-group input, +.form-group select { + padding: 0.75rem; + border: 1px solid var(--border-color); + border-radius: var(--border-radius); + background-color: var(--color-background-light); + color: var(--color-text-light); + font-family: inherit; + font-size: 1rem; +} + +body.dark-mode .form-group input, +body.dark-mode .form-group select { + background-color: #2c2c2c; + border-color: #444; +} + +.btn { + padding: 0.75rem 1.5rem; + border-radius: var(--border-radius); + border: none; + cursor: pointer; + font-weight: 600; + transition: background-color 0.2s; +} + +.btn-primary { + background-color: var(--color-primary); + color: white; +} + +.btn-primary:hover { + background-color: var(--color-accent); +} + +/* Table Styles */ +.table-responsive { + overflow-x: auto; +} + +table { + width: 100%; + border-collapse: collapse; + text-align: left; +} + +table th, table td { + padding: 1rem; + border-bottom: 1px solid var(--border-color); + vertical-align: middle; +} + +table th { + font-weight: 600; + font-size: 0.875rem; + color: var(--color-secondary); + text-transform: uppercase; +} + +/* Status Badges */ +.status-badge { + display: inline-block; + padding: 0.25em 0.6em; + font-size: 0.8rem; + font-weight: 600; + border-radius: 20px; + text-transform: capitalize; +} + +.status-pending { + background-color: #f0ad4e; + color: white; +} + +.status-in-transit { + background-color: #5bc0de; + color: white; +} + +.status-delivered { + background-color: #5cb85c; + color: white; +} + +.status-cancelled { + background-color: #d9534f; + color: white; +} + diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..cf3dffd --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,48 @@ +// assets/js/main.js +document.addEventListener('DOMContentLoaded', () => { + const themeToggle = document.getElementById('theme-toggle'); + const featherSun = document.getElementById('feather-sun'); + const featherMoon = document.getElementById('feather-moon'); + + // Function to apply theme based on saved preference or system setting + const applyTheme = (theme) => { + if (theme === 'dark') { + document.body.classList.add('dark-mode'); + if (featherSun) featherSun.style.display = 'block'; + if (featherMoon) featherMoon.style.display = 'none'; + } else { + document.body.classList.remove('dark-mode'); + if (featherSun) featherSun.style.display = 'none'; + if (featherMoon) featherMoon.style.display = 'block'; + } + }; + + // Check for saved theme in localStorage + const savedTheme = localStorage.getItem('theme'); + // Check for user's system preference + const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; + + // Apply theme on initial load + if (savedTheme) { + applyTheme(savedTheme); + } else if (prefersDark) { + applyTheme('dark'); + } else { + applyTheme('light'); + } + + + if (themeToggle) { + themeToggle.addEventListener('click', () => { + const isDarkMode = document.body.classList.toggle('dark-mode'); + const newTheme = isDarkMode ? 'dark' : 'light'; + localStorage.setItem('theme', newTheme); + applyTheme(newTheme); + }); + } + + // Feather icons replacement + if (typeof feather !== 'undefined') { + feather.replace(); + } +}); diff --git a/billing.php b/billing.php new file mode 100644 index 0000000..f812eb4 --- /dev/null +++ b/billing.php @@ -0,0 +1,16 @@ + + + + +
+
+

Billing

+
+ +
+

Invoicing and payroll content will go here.

+
+ +
+ + diff --git a/customers.php b/customers.php new file mode 100644 index 0000000..9a15e04 --- /dev/null +++ b/customers.php @@ -0,0 +1,16 @@ + + + + +
+
+

Customers

+
+ +
+

Customer and shipper management will go here.

+
+ +
+ + diff --git a/drivers.php b/drivers.php new file mode 100644 index 0000000..2e1d8dc --- /dev/null +++ b/drivers.php @@ -0,0 +1,16 @@ + + + + +
+
+

Drivers

+
+ +
+

Driver management content will go here.

+
+ +
+ + diff --git a/includes/footer.php b/includes/footer.php new file mode 100644 index 0000000..635d499 --- /dev/null +++ b/includes/footer.php @@ -0,0 +1,6 @@ + + + + + + diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..c767933 --- /dev/null +++ b/includes/header.php @@ -0,0 +1,29 @@ + + + + + + + + Datatruck TMS + + + + + + + + + + + + + + + + + + + + + diff --git a/includes/sidebar.php b/includes/sidebar.php new file mode 100644 index 0000000..f18c173 --- /dev/null +++ b/includes/sidebar.php @@ -0,0 +1,44 @@ + + diff --git a/index.php b/index.php index 7205f3d..acf65ce 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,38 @@ - -$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); -?> - - - - - - 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

-
-
- - - + + +
+
+

Dashboard Overview

+ +
+ +
+
+
ACTIVE LOADS
+
42
+
+2 since yesterday
+
+
+
DRIVERS ON-ROUTE
+
35
+
+5.2%
+
+
+
REVENUE TODAY
+
$18,450
+
+12% vs avg.
+
+
+
PENDING ISSUES
+
3
+
1 new alert
+
+
+ + + +
+ + diff --git a/loads.php b/loads.php new file mode 100644 index 0000000..f52a867 --- /dev/null +++ b/loads.php @@ -0,0 +1,127 @@ +exec("CREATE TABLE IF NOT EXISTS loads ( + id INT AUTO_INCREMENT PRIMARY KEY, + origin VARCHAR(255) NOT NULL, + destination VARCHAR(255) NOT NULL, + pickup_date DATE NOT NULL, + delivery_date DATE NOT NULL, + rate DECIMAL(10, 2) NOT NULL, + status VARCHAR(50) NOT NULL DEFAULT 'Pending', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + )"); + + // Handle form submission + if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $origin = $_POST['origin'] ?? ''; + $destination = $_POST['destination'] ?? ''; + $pickup_date = $_POST['pickup_date'] ?? ''; + $delivery_date = $_POST['delivery_date'] ?? ''; + $rate = $_POST['rate'] ?? 0; + + if ($origin && $destination && $pickup_date && $delivery_date && $rate) { + $stmt = $pdo->prepare("INSERT INTO loads (origin, destination, pickup_date, delivery_date, rate) VALUES (?, ?, ?, ?, ?)"); + $stmt->execute([$origin, $destination, $pickup_date, $delivery_date, $rate]); + header("Location: loads.php"); // Redirect to avoid form resubmission + exit; + } + } + + // Fetch all loads + $stmt = $pdo->query("SELECT id, origin, destination, pickup_date, delivery_date, rate, status, created_at FROM loads ORDER BY created_at DESC"); + $loads = $stmt->fetchAll(); + +} catch (PDOException $e) { + // For development, you might want to see the error. + // In production, you'd log this and show a generic error message. + die("Database error: " . $e->getMessage()); +} + +include 'includes/header.php'; +include 'includes/sidebar.php'; +?> + +
+
+

Load Management

+
+ +
+

Add New Load

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ +
+

Current Loads

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDOriginDestinationPickup DateDelivery DateRateStatus
No loads found.
$
+
+
+
+ +
+ + \ No newline at end of file diff --git a/maintenance.php b/maintenance.php new file mode 100644 index 0000000..cd9089f --- /dev/null +++ b/maintenance.php @@ -0,0 +1,16 @@ + + + + +
+
+

Maintenance

+
+ +
+

Maintenance records and scheduling will go here.

+
+ +
+ + diff --git a/settings.php b/settings.php new file mode 100644 index 0000000..32ebe6c --- /dev/null +++ b/settings.php @@ -0,0 +1,16 @@ + + + + +
+
+

Settings

+
+ +
+

Application settings will go here.

+
+ +
+ +