当前位置: 首页>>代码示例>>PHP>>正文


PHP sapp_Global::removeElementWithValue方法代码示例

本文整理汇总了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"));
     }
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:74,代码来源:EmployeeController.php


注:本文中的sapp_Global::removeElementWithValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。