false, 'message' => 'Ungueltige Anfrage']); exit; } header('Location: ?module=floor_infrastructure&action=list'); exit; } if ($type === 'patchpanel') { $rows = $sql->set( "DELETE FROM floor_patchpanels WHERE id = ?", "i", [$id] ); } else { $rows = $sql->set( "DELETE FROM network_outlets WHERE id = ?", "i", [$id] ); } if ($isPost) { header('Content-Type: application/json; charset=utf-8'); if ($rows > 0) { echo json_encode(['success' => true, 'message' => 'Infrastrukturobjekt geloescht']); } else { http_response_code(404); echo json_encode(['success' => false, 'message' => 'Infrastrukturobjekt nicht gefunden oder bereits geloescht']); } exit; } header('Location: ?module=floor_infrastructure&action=list'); exit;