feat: improve dashboard and connection workflows
- add connection delete endpoint and update connection list handling - expand dashboard visualization behavior - update helpers/header and project TODO tracking
This commit is contained in:
41
app/modules/connections/delete.php
Normal file
41
app/modules/connections/delete.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* app/modules/connections/delete.php
|
||||
*
|
||||
* Loescht eine Verbindung und leitet zur Liste zurueck.
|
||||
*/
|
||||
|
||||
$connectionId = (int)($_GET['id'] ?? $_POST['id'] ?? 0);
|
||||
|
||||
if ($connectionId <= 0) {
|
||||
$_SESSION['error'] = 'Ungueltige Verbindungs-ID';
|
||||
header('Location: ?module=connections&action=list');
|
||||
exit;
|
||||
}
|
||||
|
||||
$connection = $sql->single(
|
||||
"SELECT id FROM connections WHERE id = ?",
|
||||
"i",
|
||||
[$connectionId]
|
||||
);
|
||||
|
||||
if (!$connection) {
|
||||
$_SESSION['error'] = 'Verbindung nicht gefunden';
|
||||
header('Location: ?module=connections&action=list');
|
||||
exit;
|
||||
}
|
||||
|
||||
$rows = $sql->set(
|
||||
"DELETE FROM connections WHERE id = ?",
|
||||
"i",
|
||||
[$connectionId]
|
||||
);
|
||||
|
||||
if ($rows > 0) {
|
||||
$_SESSION['success'] = 'Verbindung geloescht';
|
||||
} else {
|
||||
$_SESSION['error'] = 'Verbindung konnte nicht geloescht werden';
|
||||
}
|
||||
|
||||
header('Location: ?module=connections&action=list');
|
||||
exit;
|
||||
Reference in New Issue
Block a user