本文整理汇总了PHP中sapp_Global::removeElementWithValue方法的典型用法代码示例。如果您正苦于以下问题:PHP sapp_Global::removeElementWithValue方法的具体用法?PHP sapp_Global::removeElementWithValue怎么用?PHP sapp_Global::removeElementWithValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sapp_Global
的用法示例。
在下文中一共展示了sapp_Global::removeElementWithValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeactiveinactiveAction
/**
* This function is used to active/inactive employees.
*/
public function makeactiveinactiveAction()
{
Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
$emp_id = $this->_getParam('emp_id', null);
$status = trim($this->_getParam('status', null));
$hasteam = trim($this->_getParam('hasteam', null));
$employeeModal = new Default_Model_Employee();
$user_model = new Default_Model_Usermanagement();
$usermodel = new Default_Model_Users();
$role_model = new Default_Model_Roles();
$logmanagermodel = new Default_Model_Logmanager();
$menumodel = new Default_Model_Menu();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$empData = $employeeModal->getsingleEmployeeData($emp_id);
if ($hasteam == 'true') {
$employessunderEmpId = array();
$reportingmanagersList = array();
$employessunderEmpId = $employeeModal->getEmployeesUnderRM($emp_id);
if ($empData[0]['is_orghead'] == 1) {
$reportingmanagersList = $usermodel->getReportingManagerList_employees('', '', MANAGEMENT_GROUP);
} else {
$role_data = $role_model->getRoleDataById($empData[0]['emprole']);
$reportingmanagersList = $usermodel->getReportingManagerList_employees($empData[0]['department_id'], $emp_id, $role_data['group_id']);
}
$reportingmanagersList = sapp_Global::removeElementWithValue($reportingmanagersList, 'id', $emp_id);
$this->view->emp_id = $emp_id;
$this->view->status = $status;
$this->view->ishead = $empData[0]['is_orghead'];
$this->view->empName = $empData[0]['userfullname'];
$this->view->employessunderEmpId = $employessunderEmpId;
$this->view->reportingmanagersList = $reportingmanagersList;
} else {
$db = Zend_Db_Table::getDefaultAdapter();
$db->beginTransaction();
try {
if ($status == 'active') {
$data = array('isactive' => 1, 'emptemplock' => 0);
$empdata = array('isactive' => 1);
$logarr = array('userid' => $loginUserId, 'recordid' => $emp_id, 'date' => gmdate("Y-m-d H:i:s"), 'isactive' => 1);
$jsonlogarr = json_encode($logarr);
} else {
if ($status == 'inactive') {
$data = array('isactive' => 0, 'emptemplock' => 1);
$empdata = array('isactive' => 0);
$logarr = array('userid' => $loginUserId, 'recordid' => $emp_id, 'date' => gmdate("Y-m-d H:i:s"), 'isactive' => 0);
$jsonlogarr = json_encode($logarr);
}
}
$where = "id = " . $emp_id;
$user_model->SaveorUpdateUserData($data, $where);
$employeeModal->SaveorUpdateEmployeeData($empdata, "user_id =" . $emp_id);
if ($empData[0]['is_orghead'] == '1') {
$headData = array('is_orghead' => 0);
$headWhere = "user_id = " . $emp_id;
$employeeModal->SaveorUpdateEmployeeData($headData, $headWhere);
}
$menuidArr = $menumodel->getMenuObjID('/employee');
$menuID = $menuidArr[0]['id'];
$id = $logmanagermodel->addOrUpdateLogManager($menuID, 4, $jsonlogarr, $loginUserId, $emp_id);
$db->commit();
$result = 'update';
} catch (Exception $e) {
$db->rollBack();
$result = 'failed';
}
$this->_helper->json(array('result' => $result == 'update' ? "yes" : "no"));
}
}