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;
|
||||
@@ -293,11 +293,8 @@ $mapOutlets = $sql->get(
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
//TODO drag an drop auf der stockwerkskarte für die patchfelder und wandbuchsen. buchsen haben eine einheitliche größe, und sind quadratisch, patchfelder sind auch für sich einheitlich, sind rechteckig und breiter als hoch
|
||||
//TODO style in css files einsortieren
|
||||
?>
|
||||
<script src="/assets/js/floor-infrastructure-edit.js" defer></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ if ($editorFloor) {
|
||||
<td><?php echo (int)$panel['port_count']; ?></td>
|
||||
<td class="actions">
|
||||
<a href="?module=floor_infrastructure&action=edit&type=patchpanel&id=<?php echo (int)$panel['id']; ?>" class="button button-small">Bearbeiten</a>
|
||||
<a href="?module=floor_infrastructure&action=delete&type=patchpanel&id=<?php echo (int)$panel['id']; ?>" class="button button-small button-danger" onclick="return confirm('Patchpanel wirklich loeschen?');">Loeschen</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -225,6 +226,7 @@ if ($editorFloor) {
|
||||
<td><?php echo htmlspecialchars((string)($outlet['comment'] ?? '')); ?></td>
|
||||
<td class="actions">
|
||||
<a href="?module=floor_infrastructure&action=edit&type=outlet&id=<?php echo (int)$outlet['id']; ?>" class="button button-small">Bearbeiten</a>
|
||||
<a href="?module=floor_infrastructure&action=delete&type=outlet&id=<?php echo (int)$outlet['id']; ?>" class="button button-small button-danger" onclick="return confirm('Wandbuchse wirklich loeschen?');">Loeschen</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
Reference in New Issue
Block a user