diff --git a/assets/css/custom.css b/assets/css/custom.css deleted file mode 100644 index 33dbcdd..0000000 --- a/assets/css/custom.css +++ /dev/null @@ -1,319 +0,0 @@ -/* 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; -} - -/* --- Charts --- */ -.dashboard-charts { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); - gap: 1.5rem; - margin-top: 2rem; -} - -.chart-container { - background-color: var(--color-surface-light); - padding: 1.5rem; - border-radius: var(--border-radius); - border: 1px solid var(--border-color); -} - -.chart-title { - margin-top: 0; - margin-bottom: 1.5rem; - font-weight: 600; - font-size: 1.1rem; - text-align: center; -} - -body.dark-mode .chart-container { - background-color: var(--color-surface-light); - border-color: var(--border-color); -} - diff --git a/assets/js/main.js b/assets/js/main.js deleted file mode 100644 index 2c64d19..0000000 --- a/assets/js/main.js +++ /dev/null @@ -1,127 +0,0 @@ -// 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(); - } - - // -- CHARTS INITIALIZATION -- - // Check if chartData is defined (it's passed from index.php) - if (typeof chartData !== 'undefined') { - const pieCtx = document.getElementById('loadsByStatusChart'); - const barCtx = document.getElementById('monthlyLoadsChart'); - - // Define colors that work with the theme - const chartColors = { - primary: 'rgba(184, 134, 11, 0.8)', // Golden - secondary: 'rgba(169, 169, 169, 0.8)', // Gray - accent: 'rgba(212, 175, 55, 0.8)', // Lighter Gold - success: 'rgba(40, 167, 69, 0.8)', - danger: 'rgba(220, 53, 69, 0.8)', - info: 'rgba(23, 162, 184, 0.8)', - }; - - if (pieCtx) { - new Chart(pieCtx, { - type: 'pie', - data: { - labels: chartData.loadsByStatus.labels, - datasets: [{ - label: 'Loads', - data: chartData.loadsByStatus.counts, - backgroundColor: [ - chartColors.info, - chartColors.primary, - chartColors.success, - chartColors.danger, - chartColors.secondary - ], - borderWidth: 1 - }] - }, - options: { - responsive: true, - plugins: { - legend: { - position: 'top', - } - } - } - }); - } - - if (barCtx) { - new Chart(barCtx, { - type: 'bar', - data: { - labels: chartData.monthlyLoads.labels, - datasets: [{ - label: 'Loads Created', - data: chartData.monthlyLoads.counts, - backgroundColor: chartColors.primary, - borderColor: chartColors.accent, - borderWidth: 1 - }] - }, - options: { - responsive: true, - scales: { - y: { - beginAtZero: true, - ticks: { // Make sure Y-axis ticks are integers - stepSize: 1, - callback: function(value) { if (Number.isInteger(value)) { return value; } } - } - } - }, - plugins: { - legend: { - display: false - } - } - } - }); - } - } -}); diff --git a/billing.php b/billing.php deleted file mode 100644 index f812eb4..0000000 --- a/billing.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - -
-
-

Billing

-
- -
-

Invoicing and payroll content will go here.

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

Customers

-
- -
-

Customer and shipper management will go here.

-
- -
- - diff --git a/drivers.php b/drivers.php deleted file mode 100644 index a8eca2c..0000000 --- a/drivers.php +++ /dev/null @@ -1,132 +0,0 @@ -prepare($sql); - $stmt->execute(['name' => $name, 'email' => $email, 'phone' => $phone, 'status' => $status]); - // Redirect to avoid form resubmission - header("Location: drivers.php"); - exit; - } catch (PDOException $e) { - $error_message = "Database error: " . $e->getMessage(); - } - } -} - -// Create drivers table if it doesn't exist -try { - $pdo = db(); - $pdo->exec("CREATE TABLE IF NOT EXISTS drivers ( - id INT AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(255) NOT NULL, - email VARCHAR(255) NOT NULL, - phone VARCHAR(50) NOT NULL, - status VARCHAR(50) NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP - )"); -} catch (PDOException $e) { - die("Could not create table: " . $e->getMessage()); -} - -// Fetch all drivers -try { - $pdo = db(); - $stmt = $pdo->query("SELECT id, name, email, phone, status, created_at FROM drivers ORDER BY created_at DESC"); - $drivers = $stmt->fetchAll(PDO::FETCH_ASSOC); -} catch (PDOException $e) { - $error_message = "Database error: " . $e->getMessage(); -} - -include 'includes/header.php'; -?> - - - -
-
-

Manage Drivers

-
- -
-

Add New Driver

-
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
-
- -
-

All Drivers

- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
NameContactStatusJoined
No drivers found.
-
- -
-
-
- -
- - \ No newline at end of file diff --git a/includes/footer.php b/includes/footer.php deleted file mode 100644 index 7b6b92a..0000000 --- a/includes/footer.php +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/includes/header.php b/includes/header.php deleted file mode 100644 index c767933..0000000 --- a/includes/header.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - Datatruck TMS - - - - - - - - - - - - - - - - - - - - - diff --git a/includes/sidebar.php b/includes/sidebar.php deleted file mode 100644 index f18c173..0000000 --- a/includes/sidebar.php +++ /dev/null @@ -1,44 +0,0 @@ - - diff --git a/index.php b/index.php index c8fe36d..7205f3d 100644 --- a/index.php +++ b/index.php @@ -1,102 +1,150 @@ query('SELECT count(*) FROM loads')->fetchColumn(); -$total_drivers = $pdo->query('SELECT count(*) FROM drivers')->fetchColumn(); -$in_transit_loads = $pdo->query('SELECT count(*) FROM loads WHERE status = "In-Transit"')->fetchColumn(); -$delivered_loads = $pdo->query('SELECT count(*) FROM loads WHERE status = "Delivered"')->fetchColumn(); - -// Pie Chart: Loads by Status -$loads_by_status_stmt = $pdo->query('SELECT status, count(*) as count FROM loads GROUP BY status'); -$loads_by_status = $loads_by_status_stmt->fetchAll(PDO::FETCH_ASSOC); -$status_labels = []; -$status_counts = []; -foreach ($loads_by_status as $row) { - $status_labels[] = $row['status']; - $status_counts[] = $row['count']; -} - -// Bar Chart: Loads per month -// Using a default of 0 for all months of the current year -$monthly_counts = array_fill(1, 12, 0); -$loads_by_month_stmt = $pdo->query(" - SELECT - CAST(strftime('%m', pickup_date) AS INTEGER) as month, - count(*) as count - FROM loads - WHERE strftime('%Y', pickup_date) = strftime('%Y', 'now') - GROUP BY month -"); -$loads_by_month = $loads_by_month_stmt->fetchAll(PDO::FETCH_ASSOC); - -foreach ($loads_by_month as $row) { - $monthly_counts[$row['month']] = $row['count']; -} -$monthly_labels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; -$monthly_values = array_values($monthly_counts); - - -include 'includes/header.php'; -include 'includes/sidebar.php'; +$phpVersion = PHP_VERSION; +$now = date('Y-m-d H:i:s'); ?> - -
-
-

Reports & Analytics

-
- -
-
-
TOTAL LOADS
-
-
All time
-
-
-
TOTAL DRIVERS
-
-
All time
-
-
-
IN-TRANSIT NOW
-
-
 
-
-
-
COMPLETED LOADS
-
-
 
-
-
- -
-
-

Loads by Status

- -
-
-

Monthly Load Volume (This Year)

- -
-
- -
- - - - \ No newline at end of file + body { + margin: 0; + font-family: 'Inter', sans-serif; + background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); + color: var(--text-color); + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + text-align: center; + overflow: hidden; + position: relative; + } + body::before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: url('data:image/svg+xml,'); + animation: bg-pan 20s linear infinite; + z-index: -1; + } + @keyframes bg-pan { + 0% { background-position: 0% 0%; } + 100% { background-position: 100% 100%; } + } + main { + padding: 2rem; + } + .card { + background: var(--card-bg-color); + border: 1px solid var(--card-border-color); + border-radius: 16px; + padding: 2rem; + backdrop-filter: blur(20px); + -webkit-backdrop-filter: blur(20px); + box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1); + } + .loader { + margin: 1.25rem auto 1.25rem; + width: 48px; + height: 48px; + border: 3px solid rgba(255, 255, 255, 0.25); + border-top-color: #fff; + border-radius: 50%; + animation: spin 1s linear infinite; + } + @keyframes spin { + from { transform: rotate(0deg); } + to { transform: rotate(360deg); } + } + .hint { + opacity: 0.9; + } + .sr-only { + position: absolute; + width: 1px; height: 1px; + padding: 0; margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; border: 0; + } + h1 { + font-size: 3rem; + font-weight: 700; + margin: 0 0 1rem; + letter-spacing: -1px; + } + p { + margin: 0.5rem 0; + font-size: 1.1rem; + } + code { + background: rgba(0,0,0,0.2); + padding: 2px 6px; + border-radius: 4px; + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + } + footer { + position: absolute; + bottom: 1rem; + font-size: 0.8rem; + opacity: 0.7; + } + + + +
+
+

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/loads.php b/loads.php deleted file mode 100644 index f52a867..0000000 --- a/loads.php +++ /dev/null @@ -1,127 +0,0 @@ -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 deleted file mode 100644 index cd9089f..0000000 --- a/maintenance.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - -
-
-

Maintenance

-
- -
-

Maintenance records and scheduling will go here.

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

Settings

-
- -
-

Application settings will go here.

-
- -
- -