div TODOs

This commit is contained in:
2026-02-16 13:56:01 +01:00
parent 12141485ae
commit 510a248edb
36 changed files with 1500 additions and 1533 deletions

View File

@@ -10,7 +10,7 @@
// =========================
// Filter einlesen
// =========================
$search = trim($_GET['search'] ?? '');
$search = trim($_GET['search'] ?? ');
// =========================
// Floors laden
@@ -19,7 +19,7 @@ $whereClause = "";
$types = "";
$params = [];
if ($search !== '') {
if ($search !== ') {
$whereClause = "WHERE f.name LIKE ? OR f.comment LIKE ?";
$types = "ss";
$params = ["%$search%", "%$search%"];
@@ -105,7 +105,7 @@ $buildings = $sql->get("SELECT id, name FROM buildings ORDER BY name", "", []);
</td>
<td>
<small><?php echo htmlspecialchars($floor['comment'] ?? ''); ?></small>
<small><?php echo htmlspecialchars($floor['comment'] ?? '); ?></small>
</td>
<td class="actions">
@@ -233,9 +233,24 @@ $buildings = $sql->get("SELECT id, name FROM buildings ORDER BY name", "", []);
<script>
function confirmDelete(id) {
if (confirm('Dieses Stockwerk wirklich löschen? Alle Räume und Racks werden gelöscht.')) {
// TODO: AJAX-Delete implementieren
alert('Löschen noch nicht implementiert');
if (confirm('Dieses Stockwerk wirklich loeschen? Alle Raeume und Racks werden geloescht.')) {
fetch('?module=floors&action=delete', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
body: 'id=' + encodeURIComponent(id)
})
.then((res) => res.json())
.then((data) => {
if (data && data.success) {
window.location.reload();
return;
}
alert((data && data.message) ? data.message : 'Loeschen fehlgeschlagen');
})
.catch(() => {
alert('Loeschen fehlgeschlagen');
});
}
}
</script>