Remove footer.php and some small improvements

This commit is contained in:
2023-03-10 19:31:07 +01:00
parent bfbdc16036
commit 8c61638485
23 changed files with 74 additions and 61 deletions

View File

@@ -33,7 +33,11 @@ switch ($submit = form_get_action()) {
VALUE
(?, ?, ?)";
$sth = $dbh->prepare($sql);
$sth->execute([$name, $description, $group_id]);
try {
$sth->execute([$name, $description, $group_id]);
} catch (PDOException $e) {
$g_error->Add($e->getMessage());
}
$id = $dbh->lastInsertId();
$action = ACT_VIEW;
break;
@@ -48,13 +52,20 @@ switch ($submit = form_get_action()) {
assetclassgroup_id=?
WHERE assetclass_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$name, $description, $group_id, $id]);
$action = ACT_VIEW;
try {
$sth->execute([$name, $description, $group_id, $id]);
} catch (PDOException $e) {
$g_error->Add($e->getMessage());
} $action = ACT_VIEW;
break;
case 'delete':
$sth = $dbh->prepare("DELETE FROM assetclass WHERE assetclass_id=?");
$sth->execute([$id]);
try {
$sth->execute([$id]);
} catch (PDOException $e) {
$g_error->Add($e->getMessage());
}
$action = ACT_DEFAULT;
break;
@@ -154,4 +165,3 @@ endif; // $action == ...
// ========== END OF VARIANTS =================================================
$smarty->display('footer.tpl');
?>