Files
netwatch/app/modules/floor_infrastructure/delete.php
2026-02-16 13:56:01 +01:00

32 lines
656 B
PHP

<?php
/**
* app/modules/floor_infrastructure/delete.php
*
* Loescht Patchpanels oder Wandbuchsen.
*/
$type = strtolower(trim((string)($_GET['type'] ?? '')));
$id = (int)($_GET['id'] ?? 0);
if ($id <= 0 || !in_array($type, ['patchpanel', 'outlet'], true)) {
header('Location: ?module=floor_infrastructure&action=list');
exit;
}
if ($type === 'patchpanel') {
$sql->set(
"DELETE FROM floor_patchpanels WHERE id = ?",
"i",
[$id]
);
} else {
$sql->set(
"DELETE FROM network_outlets WHERE id = ?",
"i",
[$id]
);
}
header('Location: ?module=floor_infrastructure&action=list');
exit;