if (!$_REQUEST['department']) { $errors[] = "No Department Name Specified. Please Specify a Valid Department Name."; } if (count($errors) != 0) { $smarty->assign('departmentid', $_REQUEST['deptid']); $smarty->assign('errors', $errors); $smarty->assign('department', $_REQUEST['department']); $smarty->assign('step', 'edit_department'); $smarty->assign('form', 'editdepartment'); $smarty->display('home.tpl'); } else { $Admin = new vMailAdmin(); $Info = array(); $Info['department'] = $_REQUEST['department']; $Info['deptid'] = $_REQUEST['deptid']; if (!$Admin->updateDepartment($Info)) { $errors[] = "The Department Could not be Edited. Please Ensure that all Information was entered correctly and try again."; $smarty->assign('departmentid', $_REQUEST['deptid']); $smarty->assign('errors', $errors); $smarty->assign('department', $_REQUEST['department']); $smarty->assign('step', 'edit_department'); $smarty->assign('form', 'editdepartment'); $smarty->display('home.tpl'); } else { $smarty->assign('status', 'edit_department_success'); $MySQL = new iacMySQL(); $Stats = new HomePageStats($MySQL); $smarty->assign('HomePageStats', $Stats->GiveAllStats()); $smarty->display('home.tpl'); } }