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,8 +33,11 @@ switch ($submit = form_get_action()) {
VALUE
(?, ?, ?)";
$sth = $dbh->prepare($sql);
$sth->execute([$name, $color, $desc]);
$id = $dbh->lastInsertId();
try {
$sth->execute([$name, $color, $desc]);
} catch (PDOException $e) {
$g_error->Add($e->getMessage());
} $id = $dbh->lastInsertId();
$action = ACT_VIEW;
break;
@@ -47,14 +50,21 @@ switch ($submit = form_get_action()) {
assetclassgroup_name=?, assetclassgroup_color=?, assetclassgroup_description=?
WHERE assetclassgroup_id=?";
$sth = $dbh->prepare($sql);
$sth->execute([$acg_name, $acg_color, $acg_desc, $id]);
try {
$sth->execute([$acg_name, $acg_color, $acg_desc, $id]);
} catch (PDOException $e) {
$g_error->Add($e->getMessage());
}
$action = ACT_VIEW;
break;
case 'delete':
$sth = $dbh->prepare("DELETE FROM assetclassgroup WHERE assetclassgroup_id=?");
$sth->execute([$id]);
$action = ACT_DEFAULT;
try {
$sth->execute([$id]);
} catch (PDOException $e) {
$g_error->Add($e->getMessage());
} $action = ACT_DEFAULT;
break;
default:
@@ -144,4 +154,3 @@ endif; // $action == ...
// ========== END OF VARIANTS =================================================
$smarty->display('footer.tpl');
?>