Remove footer.php and some small improvements
This commit is contained in:
@@ -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');
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user