本文整理汇总了PHP中Access::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::update方法的具体用法?PHP Access::update怎么用?PHP Access::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: List
}
if (!Error::occurred()) {
$url = AmpConfig::get('web_path') . '/admin/access.php';
show_confirmation(T_('Added'), T_('Your new Access Control List(s) have been created'), $url);
} else {
$action = 'show_add_' . $_POST['type'];
require_once AmpConfig::get('prefix') . '/templates/show_add_access.inc.php';
}
break;
case 'update_record':
if (!Core::form_verify('edit_acl')) {
UI::access_denied();
exit;
}
$access = new Access($_REQUEST['access_id']);
$access->update($_POST);
if (!Error::occurred()) {
show_confirmation(T_('Updated'), T_('Access List Entry updated'), AmpConfig::get('web_path') . '/admin/access.php');
} else {
$access->format();
require_once AmpConfig::get('prefix') . '/templates/show_edit_access.inc.php';
}
break;
case 'show_add_current':
case 'show_add_rpc':
case 'show_add_local':
case 'show_add_advanced':
$action = $_REQUEST['action'];
require_once AmpConfig::get('prefix') . '/templates/show_add_access.inc.php';
break;
case 'show_edit_record':
示例2: Database
$database = new Database();
$db = $database->getConnection();
$originalOption = new Access($db);
if (isset($_GET['id'])) {
$id = $_GET['id'];
$originalOption->Id = $id;
$originalOption->selectById();
}
if (isset($_POST['update'])) {
$updatedOption = new Access($db);
$updatedOption->Id = $_POST['id'];
$updatedOption->Code = $_POST['code'];
$updatedOption->Staff_Id = null;
$updatedOption->Staff = '';
$updatedOption->Guest_Id = $_POST['guestid'];
if ($updatedOption->update() == true) {
header("location:access.php");
} else {
echo "<script>alert('There was an error updating this item');window.location = 'access.php' </script>";
}
}
if (isset($_POST['delete'])) {
$updatedOption = new Access($db);
$updatedOption->Id = $_POST['id'];
if ($updatedOption->delete() == true) {
header("location:access.php");
} else {
echo "<script>alert('There was an error deleting this item');window.location = 'access.php' </script>";
}
}
?>