design update, div TODOs added
This commit is contained in:
@@ -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; ?>
|
||||
|
||||
Reference in New Issue
Block a user