本文整理汇总了PHP中Dept::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Dept::update方法的具体用法?PHP Dept::update怎么用?PHP Dept::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dept
的用法示例。
在下文中一共展示了Dept::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doEdit
function doEdit()
{
$deptid = $_GET['id'];
if (isset($_POST['save'])) {
if ($_POST['deptname'] == "" or $_POST['deptdesc'] == "") {
$message = "All field is required!";
redirect('index.php?view=edit&id=' . $deptid);
} else {
$dept = new Dept();
$deptid = $_GET['id'];
$deptname = $_POST['deptname'];
$dept_desc = $_POST['deptdesc'];
$dept->DEPT_ID = $deptid;
$dept->DEPARTMENT_NAME = $deptname;
$dept->DEPARTMENT_DESC = $dept_desc;
$dept->update($deptid);
$message = $deptname . " has updated successfully!";
redirect('index.php');
}
}
}
示例2: switch
}else{
$errors['err']='No users selected.';
}
break;
default:
$errors['err']='Uknown command!';
}
break;
case 'dept':
include_once(INCLUDE_DIR.'class.dept.php');
$do=strtolower($_POST['do']);
switch($do){
case 'update':
$dept = new Dept($_POST['dept_id']);
if($dept && $dept->getId()) {
if($dept->update($_POST,$errors))
$msg='Dept updated successfully';
elseif(!$errors['err'])
$errors['err']='Error updating the department';
}else{
$errors['err']='Internal error';
}
break;
case 'create':
if(($deptID=Dept::create($_POST,$errors)))
$msg=Format::htmlchars($_POST['dept_name']).' added successfully';
elseif(!$errors['err'])
$errors['err']='Unable to add department. Internal error';
break;
case 'mass_process':
if(!$_POST['ids'] || !is_array($_POST['ids'])) {