div TODOs
This commit is contained in:
31
app/modules/floor_infrastructure/delete.php
Normal file
31
app/modules/floor_infrastructure/delete.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
Reference in New Issue
Block a user