public function jobhistoryeditAction() { if (defined('EMPTABCONFIGS')) { $empOrganizationTabs = explode(",", EMPTABCONFIGS); if (in_array('emp_jobhistory', $empOrganizationTabs)) { $userID = ""; $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; $loginUserRole = $auth->getStorage()->read()->emprole; $loginUserGroup = $auth->getStorage()->read()->group_id; } $id = $this->getRequest()->getParam('userid'); $conText = 'myteam'; $call = $this->_getParam('call'); if ($call == 'ajaxcall') { $this->_helper->layout->disableLayout(); $userID = $this->_getParam('unitId') != '' ? $this->_getParam('unitId') : $this->_getParam('userid'); $conText = $this->_getParam('context') != '' ? $this->_getParam('context') : $this->getRequest()->getParam('context'); } if ($id == '') { $id = $userID; } $Uid = $id ? $id : $userID; $employeeModal = new Default_Model_Employee(); try { $empdata = $employeeModal->getsingleEmployeeData($Uid); if ($empdata == 'norows') { $this->view->rowexist = "norows"; $this->view->empdata = ""; } else { $this->view->rowexist = "rows"; if (!empty($empdata)) { $empjobhistoryModel = new Default_Model_Empjobhistory(); $view = Zend_Layout::getMvcInstance()->getView(); $objname = $this->_getParam('objname'); $refresh = $this->_getParam('refresh'); $dashboardcall = $this->_getParam('dashboardcall', null); $data = array(); $searchQuery = ''; $searchArray = array(); $tablecontent = ''; if ($refresh == 'refresh') { if ($dashboardcall == 'Yes') { $perPage = DASHBOARD_PERPAGE; } else { $perPage = PERPAGE; } $sort = 'DESC'; $by = 'e.modifieddate'; $pageNo = 1; $searchData = ''; $searchQuery = ''; $searchArray = array(); } else { $sort = $this->_getParam('sort') != '' ? $this->_getParam('sort') : 'DESC'; $by = $this->_getParam('by') != '' ? $this->_getParam('by') : 'e.modifieddate'; if ($dashboardcall == 'Yes') { $perPage = $this->_getParam('per_page', DASHBOARD_PERPAGE); } else { $perPage = $this->_getParam('per_page', PERPAGE); } $pageNo = $this->_getParam('page', 1); $searchData = $this->_getParam('searchData'); $searchData = rtrim($searchData, ','); } $dataTmp = $empjobhistoryModel->getGrid($sort, $by, $perPage, $pageNo, $searchData, $call, $dashboardcall, $Uid, $conText); array_push($data, $dataTmp); $this->view->dataArray = $data; $this->view->call = $call; $this->view->employeedata = $empdata[0]; $this->view->id = $id; $this->view->messages = $this->_helper->flashMessenger->getMessages(); } $this->view->empdata = $empdata; } } catch (Exception $e) { $this->view->rowexist = "norows"; } } else { $this->_redirect('error'); } } else { $this->_redirect('error'); } }
public function deleteAction() { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; } $id = $this->_request->getParam('objid'); $messages['message'] = ''; $messages['msgtype'] = ''; $messages['flagtype'] = ''; $actionflag = 3; if ($id) { $empjobhistoryModel = new Default_Model_Empjobhistory(); $data = array('isactive' => 0, 'modifieddate' => gmdate("Y-m-d H:i:s")); $where = array('id=?' => $id); $Id = $empjobhistoryModel->SaveorUpdateEmpJobHistory($data, $where); if ($Id == 'update') { $menuID = EMPLOYEE; $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id); $messages['message'] = 'Employee job history deleted successfully.'; $messages['msgtype'] = 'success'; } else { $messages['message'] = 'Employee job history cannot be deleted.'; $messages['msgtype'] = 'error'; } } else { $messages['message'] = 'Employee job history cannot be deleted.'; $messages['msgtype'] = 'error'; } $this->_helper->json($messages); }