Checks before removing objects
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user