diff --git a/app/assets/css/app.css b/app/assets/css/app.css index d1fe7c9..fa37a8f 100644 --- a/app/assets/css/app.css +++ b/app/assets/css/app.css @@ -74,6 +74,7 @@ body { main { padding: 24px 32px 48px; + min-height: calc(100vh - 200px); } /* Shared components -------------------------------------------------- */ @@ -188,3 +189,7 @@ main { flex-wrap: wrap; } } + +footer>p { + margin-bottom: 0; +} \ No newline at end of file diff --git a/app/modules/buildings/edit.php b/app/modules/buildings/edit.php index bece049..f315e43 100644 --- a/app/modules/buildings/edit.php +++ b/app/modules/buildings/edit.php @@ -19,11 +19,13 @@ if ($buildingId > 0) { $isEdit = !empty($building); $pageTitle = $isEdit ? "Gebäude bearbeiten: " . htmlspecialchars($building['name']) : "Neues Gebäude"; +$prefillLocationId = (int)($_GET['location_id'] ?? 0); // ========================= // Standorte laden // ========================= $locations = $sql->get("SELECT id, name FROM locations ORDER BY name", "", []); +$selectedLocationId = $building['location_id'] ?? $prefillLocationId; ?> @@ -55,7 +57,7 @@ $locations = $sql->get("SELECT id, name FROM locations ORDER BY name", "", []); diff --git a/app/modules/devices/list.php b/app/modules/devices/list.php index fb4512e..fbe2986 100644 --- a/app/modules/devices/list.php +++ b/app/modules/devices/list.php @@ -202,6 +202,9 @@ $racks = $sql->get("SELECT id, name FROM racks ORDER BY name", "", []); Bearbeiten Löschen + diff --git a/app/modules/floors/edit.php b/app/modules/floors/edit.php index 4c6b280..34d0a48 100644 --- a/app/modules/floors/edit.php +++ b/app/modules/floors/edit.php @@ -22,6 +22,8 @@ if ($floorId > 0) { $isEdit = !empty($floor); $pageTitle = $isEdit ? "Stockwerk bearbeiten: " . htmlspecialchars($floor['name']) : "Neues Stockwerk"; $buildings = $sql->get("SELECT id, name FROM buildings ORDER BY name", "", []); +$prefillBuildingId = (int)($_GET['building_id'] ?? 0); +$selectedBuildingId = $floor['building_id'] ?? $prefillBuildingId; $existingSvgContent = ''; if (!empty($floor['svg_path'])) { @@ -73,7 +75,7 @@ if (!empty($floor['svg_path'])) { diff --git a/app/modules/locations/list.php b/app/modules/locations/list.php index e08a50a..f0e78fb 100644 --- a/app/modules/locations/list.php +++ b/app/modules/locations/list.php @@ -34,6 +34,32 @@ $locations = $sql->get( $params ); +$buildings = $sql->get( + "SELECT b.id, b.location_id, b.name, b.comment + FROM buildings b + ORDER BY b.location_id, b.name", + "", + [] +); + +$buildingsByLocation = []; +foreach ($buildings as $building) { + $buildingsByLocation[$building['location_id']][] = $building; +} + +$floors = $sql->get( + "SELECT f.id, f.building_id, f.name, f.level + FROM floors f + ORDER BY f.building_id, f.level", + "", + [] +); + +$floorsByBuilding = []; +foreach ($floors as $floor) { + $floorsByBuilding[$floor['building_id']][] = $floor; +} + ?>
@@ -104,7 +130,83 @@ $locations = $sql->get(
+ +
+

Gebäude & Stockwerke nach Standorten

+ + + +

Keine Standorte gefunden.

+ +
+ + diff --git a/app/templates/header.php b/app/templates/header.php index 12e8879..51abd6f 100644 --- a/app/templates/header.php +++ b/app/templates/header.php @@ -36,12 +36,10 @@ $navItems = [ 'dashboard' => 'Dashboard', 'locations' => 'Standorte', - 'buildings' => 'Gebäude', 'device_types' => 'Gerätetypen', 'port_types' => 'Porttypen', 'devices' => 'Geräte', 'racks' => 'Racks', - 'floors' => 'Stockwerke', 'connections' => 'Verbindungen', ]; ?>