Example #1
0
// login if not autheticated
require $ACCOUNTS_PATH . 'include/auth_login_redirect.php';
// Make sure user is authorized
$allowed = false;
// assume user is NOT allowed unless otherwise shown
if (!$User->checkPerm("admin_accounts")) {
    $allowed = false;
    $Message = "Only admins with <b>admin_accounts</b> or <b>admin_insts</b> may view this page.<br/>" . "Try out this one instead: <a href='{$TOOL_PATH}/'>{$TOOL_NAME}</a>";
} else {
    $allowed = true;
}
// delete an item
if ($_REQUEST["itemdel"] && $allowed) {
    $itemPK = $_REQUEST["itemdel"];
    $delItem = new Institution($itemPK);
    if (!$delItem->delete()) {
        $Message = "Error: Could not remove item: " . $delItem->Message;
    }
}
// create an empty institution object for searching
$opInst = new Institution();
// get the search
$searchtext = "";
if ($_REQUEST["searchtext"]) {
    $searchtext = $_REQUEST["searchtext"];
}
// sorting
$sortorder = "name";
if ($_REQUEST["sortorder"]) {
    $sortorder = $_REQUEST["sortorder"];
}