Partially done
All checks were successful
Build and Deploy Zola Website / build_and_deploy (push) Successful in 16s

This commit is contained in:
2025-01-26 22:22:12 +01:00
parent 18c78e37a4
commit 2201430f59
8 changed files with 215 additions and 21 deletions

View File

@ -52,10 +52,21 @@ class VehicleController extends Controller {
public function edit() {
// Edit vehicle (to be implemented later)
// TODO: Edit vehicle (to be implemented later)
}
public function delete() {
// Delete vehicle (to be implemented later)
// TODO: Delete vehicle (to be implemented later)
}
public function api_get() {
if(!$_SERVER['REQUEST_METHOD'] === 'GET') {
echo "Wrong method, use GET";
return;
}
$vehicle = new Vehicle();
$result = $vehicle->getVehiclesByUser($_SESSION['user']['id']);
echo json_encode($result);
}
}

View File

@ -1,11 +1,14 @@
<link rel="stylesheet" href="/css/dashboard.css">
<link rel="stylesheet" href="/css/form.css">
<link rel="stylesheet" href="/css/vehicle_create.css">
<section class="dashboard">
<h1>Welcome, <?= htmlspecialchars($_SESSION['user']['username']) ?>!</h1>
<div>
<div id="actions">
<a href="/refuel/create" class="btn-green">Add new refuel record!</a>
<a href="/vehicles" class="btn-primary">List all vehicles</a>
<button class="btn-primary" id="btn-offline-add">Add new refuel record OFFLINE</button>
<a class="btn-warning" id="btn-offline-add">Add new offline refuel record</a>
</div>
<div class="card-wrapper">
<section class="card latest">