Auto commit: 2025-10-22T13:28:04.969Z
This commit is contained in:
parent
4b4d4b857b
commit
fac3d8cd1c
38
assets/css/custom.css
Normal file
38
assets/css/custom.css
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/* assets/css/custom.css */
|
||||||
|
body {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-brand {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state {
|
||||||
|
text-align: center;
|
||||||
|
padding: 4rem 2rem;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
border: 1px dashed #ced4da;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state i {
|
||||||
|
font-size: 3rem;
|
||||||
|
color: #adb5bd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state h5 {
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state p {
|
||||||
|
color: #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toast-container {
|
||||||
|
z-index: 1090;
|
||||||
|
}
|
||||||
9
assets/js/main.js
Normal file
9
assets/js/main.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// assets/js/main.js
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
// Activate toasts
|
||||||
|
var toastElList = [].slice.call(document.querySelectorAll('.toast'));
|
||||||
|
var toastList = toastElList.map(function (toastEl) {
|
||||||
|
return new bootstrap.Toast(toastEl);
|
||||||
|
});
|
||||||
|
toastList.forEach(toast => toast.show());
|
||||||
|
});
|
||||||
@ -1,17 +1,63 @@
|
|||||||
<?php
|
<?php
|
||||||
// Generated by setup_mariadb_project.sh — edit as needed.
|
// db/config.php
|
||||||
define('DB_HOST', '127.0.0.1');
|
|
||||||
define('DB_NAME', 'app_30972');
|
|
||||||
define('DB_USER', 'app_30972');
|
|
||||||
define('DB_PASS', '9eb17a13-4a89-4e11-8517-0c201096e935');
|
|
||||||
|
|
||||||
function db() {
|
function db_connect() {
|
||||||
static $pdo;
|
static $pdo;
|
||||||
if (!$pdo) {
|
if ($pdo) {
|
||||||
$pdo = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=utf8mb4', DB_USER, DB_PASS, [
|
return $pdo;
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
}
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
]);
|
// Database credentials - DO NOT MODIFY
|
||||||
}
|
$host = '127.0.0.1';
|
||||||
return $pdo;
|
$dbname = 'app';
|
||||||
|
$user = 'app';
|
||||||
|
$pass = 'app';
|
||||||
|
$port = 3306;
|
||||||
|
$charset = 'utf8mb4';
|
||||||
|
|
||||||
|
$dsn = "mysql:host=$host;port=$port;dbname=$dbname;charset=$charset";
|
||||||
|
$options = [
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
PDO::ATTR_EMULATE_PREPARES => false,
|
||||||
|
];
|
||||||
|
|
||||||
|
try {
|
||||||
|
$pdo = new PDO($dsn, $user, $pass, $options);
|
||||||
|
return $pdo;
|
||||||
|
} catch ([31m[4mPDOException[0m $e) {
|
||||||
|
// In a real app, log this error and show a generic message
|
||||||
|
throw new [31m[4mPDOException[0m($e->getMessage(), (int)$e->getCode());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function run_migrations() {
|
||||||
|
$pdo = db_connect();
|
||||||
|
$migrationsDir = __DIR__ . '/migrations';
|
||||||
|
if (!is_dir($migrationsDir)) {
|
||||||
|
mkdir($migrationsDir, 0775, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$migrationFiles = glob($migrationsDir . '/*.sql');
|
||||||
|
sort($migrationFiles);
|
||||||
|
|
||||||
|
foreach ($migrationFiles as $file) {
|
||||||
|
try {
|
||||||
|
$sql = file_get_contents($file);
|
||||||
|
if (!empty(trim($sql))) {
|
||||||
|
$pdo->exec($sql);
|
||||||
|
}
|
||||||
|
} catch ([31m[4mPDOException[0m $e) {
|
||||||
|
// Log error, handle failure
|
||||||
|
error_log("Migration failed for file $file: " . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run migrations automatically on include
|
||||||
|
run_migrations();
|
||||||
|
|
||||||
|
// Helper function for easy access
|
||||||
|
function db() {
|
||||||
|
return db_connect();
|
||||||
|
}
|
||||||
11
db/migrations/001_create_vehicles_table.sql
Normal file
11
db/migrations/001_create_vehicles_table.sql
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS `vehicles` (
|
||||||
|
`id` INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
`license_plate` VARCHAR(255) NOT NULL,
|
||||||
|
`model` VARCHAR(255) NOT NULL,
|
||||||
|
`current_mileage` INT,
|
||||||
|
`assigned_driver` VARCHAR(255),
|
||||||
|
`next_service_due` DATE,
|
||||||
|
`photo` VARCHAR(255) NULL,
|
||||||
|
`last_maintenance_date` DATE NULL,
|
||||||
|
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
10
includes/footer.php
Normal file
10
includes/footer.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="container mt-5 py-3 text-center text-muted border-top">
|
||||||
|
<p>© <?php echo date('Y'); ?> flkeet. Built with Flatlogic.</p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
38
includes/header.php
Normal file
38
includes/header.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>flkeet - Fleet Management</title>
|
||||||
|
<meta name="description" content="Fleet maintenance app to manage vehicles, maintenance records, documents and automated reminders.">
|
||||||
|
<meta name="keywords" content="fleet management, vehicle maintenance, service records, maintenance schedule, vehicle tracking, fleet maintenance software, car maintenance log, Built with Flatlogic Generator">
|
||||||
|
<meta property="og:title" content="flkeet">
|
||||||
|
<meta property="og:description" content="Fleet maintenance app to manage vehicles, maintenance records, documents and automated reminders.">
|
||||||
|
<meta property="og:image" content="">
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta name="twitter:image" content="">
|
||||||
|
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||||
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="index.php"><i class="bi bi-truck"></i> flkeet</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
|
<ul class="navbar-nav">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" aria-current="page" href="vehicles.php">Vehicles</a>
|
||||||
|
</li>
|
||||||
|
<!-- Add other links here later, e.g., Maintenance, Reports -->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<main class="container mt-4">
|
||||||
152
index.php
152
index.php
@ -1,150 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
// Redirect to the main application page
|
||||||
@ini_set('display_errors', '1');
|
header('Location: vehicles.php');
|
||||||
@error_reporting(E_ALL);
|
exit();
|
||||||
@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>
|
|
||||||
169
vehicles.php
Normal file
169
vehicles.php
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
require_once 'db/config.php';
|
||||||
|
|
||||||
|
$pdo = db();
|
||||||
|
$message = null;
|
||||||
|
$error = null;
|
||||||
|
|
||||||
|
// Handle form submission for adding a new vehicle
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
$license_plate = trim($_POST['license_plate'] ?? '');
|
||||||
|
$model = trim($_POST['model'] ?? '');
|
||||||
|
$current_mileage = filter_input(INPUT_POST, 'current_mileage', FILTER_VALIDATE_INT, ["options" => ["min_range"=>0]]);
|
||||||
|
$assigned_driver = trim($_POST['assigned_driver'] ?? '');
|
||||||
|
$next_service_due = trim($_POST['next_service_due'] ?? '');
|
||||||
|
|
||||||
|
if (empty($license_plate) || empty($model)) {
|
||||||
|
$error = "License plate and model are required.";
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
$stmt = $pdo->prepare(
|
||||||
|
"INSERT INTO vehicles (license_plate, model, current_mileage, assigned_driver, next_service_due) VALUES (?, ?, ?, ?, ?)"
|
||||||
|
);
|
||||||
|
$stmt->execute([
|
||||||
|
$license_plate,
|
||||||
|
$model,
|
||||||
|
$current_mileage ?: null,
|
||||||
|
$assigned_driver ?: null,
|
||||||
|
empty($next_service_due) ? null : $next_service_due
|
||||||
|
]);
|
||||||
|
$message = "Vehicle '{$license_plate}' added successfully!";
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
$error = "Database error: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch all vehicles to display
|
||||||
|
$vehicles = [];
|
||||||
|
try {
|
||||||
|
$stmt = $pdo->query("SELECT id, license_plate, model, current_mileage, assigned_driver, next_service_due FROM vehicles ORDER BY created_at DESC");
|
||||||
|
$vehicles = $stmt->fetchAll();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
$error = "Could not fetch vehicles: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
include 'includes/header.php';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- Toast notifications -->
|
||||||
|
<div class="toast-container position-fixed top-0 end-0 p-3">
|
||||||
|
<?php if ($message): ?>
|
||||||
|
<div class="toast align-items-center text-white bg-success border-0" role="alert" aria-live="assertive" aria-atomic="true">
|
||||||
|
<div class="d-flex">
|
||||||
|
<div class="toast-body">
|
||||||
|
<i class="bi bi-check-circle-fill"></i> <?php echo htmlspecialchars($message); ?>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($error): ?>
|
||||||
|
<div class="toast align-items-center text-white bg-danger border-0" role="alert" aria-live="assertive" aria-atomic="true">
|
||||||
|
<div class="d-flex">
|
||||||
|
<div class="toast-body">
|
||||||
|
<i class="bi bi-exclamation-triangle-fill"></i> <?php echo htmlspecialchars($error); ?>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
|
<h1 class="h2">Fleet Overview</h1>
|
||||||
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addVehicleModal">
|
||||||
|
<i class="bi bi-plus-circle"></i> Add New Vehicle
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
All Vehicles
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<?php if (empty($vehicles)): ?>
|
||||||
|
<div class="empty-state">
|
||||||
|
<i class="bi bi-truck-front"></i>
|
||||||
|
<h5>No vehicles yet</h5>
|
||||||
|
<p>Get started by adding your first vehicle to the fleet.</p>
|
||||||
|
<button type="button" class="btn btn-primary mt-2" data-bs-toggle="modal" data-bs-target="#addVehicleModal">
|
||||||
|
Add Vehicle
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead class="table-light">
|
||||||
|
<tr>
|
||||||
|
<th scope="col">License Plate</th>
|
||||||
|
<th scope="col">Model</th>
|
||||||
|
<th scope="col">Mileage</th>
|
||||||
|
<th scope="col">Assigned Driver</th>
|
||||||
|
<th scope="col">Next Service Due</th>
|
||||||
|
<th scope="col">Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($vehicles as $vehicle): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo htmlspecialchars($vehicle['license_plate']); ?></td>
|
||||||
|
<td><?php echo htmlspecialchars($vehicle['model']); ?></td>
|
||||||
|
<td><?php echo $vehicle['current_mileage'] ? htmlspecialchars(number_format($vehicle['current_mileage'])) . ' km' : 'N/A'; ?></td>
|
||||||
|
<td><?php echo $vehicle['assigned_driver'] ? htmlspecialchars($vehicle['assigned_driver']) : 'N/A'; ?></td>
|
||||||
|
<td><?php echo $vehicle['next_service_due'] ? htmlspecialchars(date("M d, Y", strtotime($vehicle['next_service_due']))) : 'N/A'; ?></td>
|
||||||
|
<td>
|
||||||
|
<a href="#" class="btn btn-sm btn-outline-secondary"><i class="bi bi-pencil"></i></a>
|
||||||
|
<a href="#" class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Add Vehicle Modal -->
|
||||||
|
<div class="modal fade" id="addVehicleModal" tabindex="-1" aria-labelledby="addVehicleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<form action="vehicles.php" method="POST">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="addVehicleModalLabel">Add New Vehicle</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="license_plate" class="form-label">License Plate <span class="text-danger">*</span></label>
|
||||||
|
<input type="text" class="form-control" id="license_plate" name="license_plate" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="model" class="form-label">Model <span class="text-danger">*</span></label>
|
||||||
|
<input type="text" class="form-control" id="model" name="model" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="current_mileage" class="form-label">Current Mileage (km)</label>
|
||||||
|
<input type="number" class="form-control" id="current_mileage" name="current_mileage" min="0">
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="assigned_driver" class="form-label">Assigned Driver</label>
|
||||||
|
<input type="text" class="form-control" id="assigned_driver" name="assigned_driver">
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="next_service_due" class="form-label">Next Service Due</label>
|
||||||
|
<input type="date" class="form-control" id="next_service_due" name="next_service_due">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||||
|
<button type="submit" class="btn btn-primary">Save Vehicle</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php include 'includes/footer.php'; ?>
|
||||||
Loading…
x
Reference in New Issue
Block a user