Compare commits
No commits in common. "ai-dev" and "master" have entirely different histories.
@ -1,77 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
<main class="content">
|
|
||||||
<h1 class="h2 mb-4">Dashboard</h1>
|
|
||||||
<div class="row">
|
|
||||||
<!-- Stat Card: Current Stock -->
|
|
||||||
<div class="col-md-4 mb-4">
|
|
||||||
<div class="card stat-card">
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="icon-circle bg-primary-soft">
|
|
||||||
<i class="bi bi-droplet-half"></i>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 class="card-title text-muted fw-normal mb-1">Current Stock</h5>
|
|
||||||
<h2 class="card-text fw-bold">0 <small class="text-muted fs-6">Liters</small></h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Stat Card: Total Received -->
|
|
||||||
<div class="col-md-4 mb-4">
|
|
||||||
<div class="card stat-card">
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="icon-circle bg-success-soft">
|
|
||||||
<i class="bi bi-arrow-down-circle"></i>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 class="card-title text-muted fw-normal mb-1">Total Received</h5>
|
|
||||||
<h2 class="card-text fw-bold">0 <small class="text-muted fs-6">Liters</small></h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Stat Card: Total Issued -->
|
|
||||||
<div class="col-md-4 mb-4">
|
|
||||||
<div class="card stat-card">
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="icon-circle bg-warning-soft">
|
|
||||||
<i class="bi bi-arrow-up-circle"></i>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 class="card-title text-muted fw-normal mb-1">Total Issued</h5>
|
|
||||||
<h2 class="card-text fw-bold">0 <small class="text-muted fs-6">Liters</small></h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card mt-4">
|
|
||||||
<div class="card-header">
|
|
||||||
<h5 class="card-title mb-0">Recent Activity</h5>
|
|
||||||
</div>
|
|
||||||
<div class="card-body text-center text-muted">
|
|
||||||
<p class="mb-0 p-4">No recent fuel movements. Start by adding a fuel receipt or issuing fuel.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
76
db_setup.php
76
db_setup.php
@ -1,76 +0,0 @@
|
|||||||
<?php
|
|
||||||
// This script sets up the database tables required for the application.
|
|
||||||
// You can run this file from your browser or the command line to initialize the database.
|
|
||||||
|
|
||||||
require_once 'db/config.php';
|
|
||||||
|
|
||||||
try {
|
|
||||||
$pdo = db();
|
|
||||||
$pdo->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 "<div style='font-family: sans-serif; padding: 20px; border: 1px solid #d4edda; background-color: #f5fff7; color: #155724;'>";
|
|
||||||
echo "<strong>Success!</strong> Database tables created successfully.";
|
|
||||||
echo "<br><br><a href='/'>Go to Dashboard</a>";
|
|
||||||
echo "</div>";
|
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
echo "<div style='font-family: sans-serif; padding: 20px; border: 1px solid #f5c6cb; background-color: #fff6f6; color: #721c24;'>";
|
|
||||||
die("<strong>Error:</strong> Could not create tables. " . $e->getMessage());
|
|
||||||
echo "</div>";
|
|
||||||
}
|
|
||||||
153
index.php
153
index.php
@ -1,5 +1,150 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once 'templates/header.php';
|
declare(strict_types=1);
|
||||||
require_once 'templates/sidebar.php';
|
@ini_set('display_errors', '1');
|
||||||
require_once 'dashboard.php';
|
@error_reporting(E_ALL);
|
||||||
require_once 'templates/footer.php';
|
@date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
$phpVersion = PHP_VERSION;
|
||||||
|
$now = date('Y-m-d H:i:s');
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>New Style</title>
|
||||||
|
<?php
|
||||||
|
// Read project preview data from environment
|
||||||
|
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||||
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||||
|
?>
|
||||||
|
<?php if ($projectDescription): ?>
|
||||||
|
<!-- Meta description -->
|
||||||
|
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||||
|
<!-- Open Graph meta tags -->
|
||||||
|
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
|
<!-- Twitter meta tags -->
|
||||||
|
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($projectImageUrl): ?>
|
||||||
|
<!-- Open Graph image -->
|
||||||
|
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
|
<!-- Twitter image -->
|
||||||
|
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||||
|
<?php endif; ?>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg-color-start: #6a11cb;
|
||||||
|
--bg-color-end: #2575fc;
|
||||||
|
--text-color: #ffffff;
|
||||||
|
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||||
|
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
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,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<div class="card">
|
||||||
|
<h1>Analyzing your requirements and generating your website…</h1>
|
||||||
|
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||||
|
<span class="sr-only">Loading…</span>
|
||||||
|
</div>
|
||||||
|
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||||
|
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||||
|
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer>
|
||||||
|
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
</div>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title><?php echo htmlspecialchars(getenv('PROJECT_NAME') ?: 'Fuel Control'); ?></title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
|
|
||||||
<link href="assets/css/custom.css?v=<?php echo time(); ?>" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="d-flex">
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
<div class="sidebar p-3">
|
|
||||||
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
|
|
||||||
<i class="bi bi-fuel-pump-fill me-2" style="font-size: 2rem; color: #0d6efd;"></i>
|
|
||||||
<span class="fs-4">Fuel Control</span>
|
|
||||||
</a>
|
|
||||||
<hr>
|
|
||||||
<ul class="nav nav-pills flex-column mb-auto">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="#" class="nav-link active" aria-current="page">
|
|
||||||
<i class="bi bi-grid-1x2-fill"></i>
|
|
||||||
Dashboard
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-dark">
|
|
||||||
<i class="bi bi-truck-front-fill"></i>
|
|
||||||
Equipment
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-dark">
|
|
||||||
<i class="bi bi-person-fill"></i>
|
|
||||||
Operators
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-dark">
|
|
||||||
<i class="bi bi-geo-alt-fill"></i>
|
|
||||||
Locations
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<hr>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-dark">
|
|
||||||
<i class="bi bi-box-arrow-in-down"></i>
|
|
||||||
Fuel Receipts
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-dark">
|
|
||||||
<i class="bi bi-box-arrow-up"></i>
|
|
||||||
Fuel Issues
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<hr>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="nav-link text-dark">
|
|
||||||
<i class="bi bi-table"></i>
|
|
||||||
Reports
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user