/** * method Delete() * Delete a record */ function Delete($param) { try { // get the parameter $key $key = $param['key']; // open a transaction with database 'permission' TTransaction::open('permission'); // instantiates object System_user $object = new SystemUser($key); // deletes the object from the database $object->delete(); // close the transaction TTransaction::close(); // reload the listing $this->onReload($param); // shows the success message new TMessage('info', TAdiantiCoreTranslator::translate('Record deleted')); } catch (Exception $e) { // shows the exception error message new TMessage('error', '<b>Error</b> ' . $e->getMessage()); // undo all pending operations TTransaction::rollback(); } }
// page vars $page_title = ""; $id = $_REQUEST['id']; // id required if ($id == "") { header("Location:mainpage.php"); exit; } // if form was submitted if ($_POST['commit'] == "Cancel") { header("Location:user_list.php"); exit; } if ($_POST['commit'] == "Delete User") { $objSystemUser = new SystemUser(); $objSystemUser->delete($id); header("Location:user_list.php"); exit; } $objSystemUser = new SystemUser($id); include "includes/pagetemplate.php"; function PageContent() { global $objSystemUser; global $id; ?> <div class="layout laymidwidth"> <?php $aLabels = array();