From 652b04bfa109cb45ea7b0d655df38627dfd69aeb Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Sat, 1 Feb 2025 19:02:24 +0100 Subject: [PATCH] Updated: Vehicle list hides "Set as default" for default vehicle and improves styling --- app/models/Vehicle.php | 2 +- app/views/vehicles/index.php | 4 +++- public/css/vehicles.css | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/models/Vehicle.php b/app/models/Vehicle.php index 13f214f..550adaa 100644 --- a/app/models/Vehicle.php +++ b/app/models/Vehicle.php @@ -35,7 +35,7 @@ class Vehicle { } public function getVehiclesByUser($user_id) { - $stmt = $this->db->prepare("SELECT id, name, registration_plate, fuel_type, note, created_at FROM vehicles WHERE user_id = ?"); + $stmt = $this->db->prepare("SELECT id, name, registration_plate, fuel_type, note, is_default, created_at FROM vehicles WHERE user_id = ?"); $stmt->bind_param("i", $user_id); $stmt->execute(); $result = $stmt->get_result(); diff --git a/app/views/vehicles/index.php b/app/views/vehicles/index.php index 6111b65..7a37767 100644 --- a/app/views/vehicles/index.php +++ b/app/views/vehicles/index.php @@ -14,18 +14,20 @@

-
+

+
+
diff --git a/public/css/vehicles.css b/public/css/vehicles.css index c6b6102..408dbee 100644 --- a/public/css/vehicles.css +++ b/public/css/vehicles.css @@ -27,3 +27,10 @@ align-items: center; margin-bottom: 1rem; } + +.vehicle-actions { + display: flex; + flex-direction: row; + gap: .5rem; + margin-top: 1rem; +}