design update, div TODOs added

This commit is contained in:
2026-02-12 10:15:46 +01:00
parent 985fc05aa1
commit be3bbf01f2
6 changed files with 219 additions and 4 deletions

View File

@@ -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", "", []);
<option value="">- Wählen -</option>
<?php foreach ($locations as $location): ?>
<option value="<?php echo $location['id']; ?>"
<?php echo ($building['location_id'] ?? 0) == $location['id'] ? 'selected' : ''; ?>>
<?php echo ((int)$selectedLocationId === (int)$location['id']) ? 'selected' : ''; ?>>
<?php echo htmlspecialchars($location['name']); ?>
</option>
<?php endforeach; ?>