Checks before removing objects

This commit is contained in:
2023-03-10 20:03:21 +01:00
parent 8c61638485
commit 02980bbad5
7 changed files with 36 additions and 2 deletions

View File

@@ -118,7 +118,14 @@ switch ($submit = form_get_action()) {
break;
case 'delete':
$sth = $dbh->prepare("DELETE FROM subnetlocation WHERE location_id=?");
$sth->execute([$id]);
$n = $sth->rowCount();
if ($n > 0) {
$g_message->Add("$n Subnetzzuordnungen wurden entfernt.");
}
$sth = $dbh->prepare("DELETE FROM location WHERE location_id=?");
$g_message->Add("Standort wurde gelöscht.");
$sth->execute([$id]);
$action = ACT_DEFAULT;
break;