public function trainingeditAction() { if (defined('EMPTABCONFIGS')) { $empOrganizationTabs = explode(",", EMPTABCONFIGS); if (in_array('trainingandcertification_details', $empOrganizationTabs)) { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; } $userid = $this->getRequest()->getParam('userid'); //This is User_id taking from URL $call = $this->_getParam('call'); if ($call == 'ajaxcall') { $this->_helper->layout->disableLayout(); $userID = $this->_getParam('unitId') != '' ? $this->_getParam('unitId') : $this->_getParam('userid'); } $Uid = $userid ? $userid : $userID; //die; //Check for this user id record exists or not.... $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)) { $TandCdetailsModel = new Default_Model_Trainingandcertificationdetails(); $call = $this->_getParam('call'); if ($call == 'ajaxcall') { $this->_helper->layout->disableLayout(); $userID = $this->_getParam('unitId') != '' ? $this->_getParam('unitId') : $this->_getParam('userid'); } $view = Zend_Layout::getMvcInstance()->getView(); $objname = $this->_getParam('objname'); $refresh = $this->_getParam('refresh'); $data = array(); $searchQuery = ''; $searchArray = array(); $tablecontent = ''; $employeeData = array(); if ($refresh == 'refresh') { $sort = 'DESC'; $by = 'modifieddate'; $perPage = PERPAGE; $pageNo = 1; $searchData = ''; } else { $sort = $this->_getParam('sort') != '' ? $this->_getParam('sort') : 'DESC'; $by = $this->_getParam('by') != '' ? $this->_getParam('by') : 'modifieddate'; $perPage = $this->_getParam('per_page', PERPAGE); $pageNo = $this->_getParam('page', 1); $searchData = $this->_getParam('searchData'); $searchData = rtrim($searchData, ','); /** search from grid - START **/ $searchData = $this->_getParam('searchData'); if ($searchData != '' && $searchData != 'undefined') { $searchValues = json_decode($searchData); foreach ($searchValues as $key => $val) { $searchQuery .= " " . $key . " like '%" . $val . "%' AND "; $searchArray[$key] = $val; } $searchQuery = rtrim($searchQuery, " AND"); } /** search from grid - END **/ } $objName = 'trainingandcertificationdetails'; $tableFields = array('action' => 'Action', 'course_name' => 'Course Name', 'course_level' => 'Course Level', 'course_offered_by' => 'Course Offered By', 'certification_name' => 'Certification Name'); $tablecontent = $TandCdetailsModel->getTandCdetailsData($sort, $by, $pageNo, $perPage, $searchQuery, $Uid); $dataTmp = array('userid' => $Uid, 'sort' => $sort, 'by' => $by, 'pageNo' => $pageNo, 'perPage' => $perPage, 'tablecontent' => $tablecontent, 'objectname' => $objName, 'extra' => array(), 'tableheader' => $tableFields, 'jsGridFnName' => 'getEmployeeAjaxgridData', 'jsFillFnName' => '', 'searchArray' => $searchArray, 'add' => 'add', 'menuName' => TAB_EMP_TRAINING_CERTIFY, 'formgrid' => 'true', 'unitId' => $Uid, 'call' => $call, 'context' => 'myteam'); array_push($data, $dataTmp); $this->view->id = $Uid; //User_id sending to view for tabs navigation.... $this->view->controllername = $objName; $this->view->dataArray = $data; $this->view->employeedata = $empdata[0]; $this->view->call = $call; $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'); } }