本文整理汇总了PHP中Institution::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Institution::delete方法的具体用法?PHP Institution::delete怎么用?PHP Institution::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Institution
的用法示例。
在下文中一共展示了Institution::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Institution
// 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"];
}