public function editAction() { $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; } $id = $this->getRequest()->getParam('id'); $IdentityCodesform = new Default_Form_identitycodes(); $IdentityCodesModel = new Default_Model_Identitycodes(); try { if ($id && $id > 0 && is_numeric($id)) { $id = abs($id); $data = $IdentityCodesModel->getIdentitycodesRecord_i($id); if (!empty($data)) { $IdentityCodesform->setDefault("employee_code", $data[0]["employee_code"]); $IdentityCodesform->setDefault("bg_code", $data[0]["backgroundagency_code"]); $IdentityCodesform->setDefault("vendor_code", $data[0]["vendors_code"]); $IdentityCodesform->setDefault("staffing_code", $data[0]["staffing_code"]); $IdentityCodesform->setDefault("users_code", $data[0]["users_code"]); $IdentityCodesform->setDefault("requisition_code", $data[0]["requisition_code"]); $IdentityCodesform->submit->setLabel('Update'); $this->view->id = $id; $this->view->nodata = ''; } else { $this->view->nodata = 'norecord'; } $IdentityCodesform->setAttrib('action', BASE_URL . 'identitycodes/edit/id/' . $id); } else { $this->view->nodata = 'norecord'; } } catch (Exception $e) { $this->view->nodata = 'nodata'; } /* Removing the codes which we are not being using for the first phase*/ $IdentityCodesform->removeElement('vendor_code'); $IdentityCodesform->removeElement('staffing_code'); if (!sapp_Global::_isactivemodule(BGCHECKS)) { $IdentityCodesform->removeElement('bg_code'); } if (!sapp_Global::_isactivemodule(RESOURCEREQUISITION)) { $IdentityCodesform->removeElement('requisition_code'); } $this->view->form = $IdentityCodesform; if ($this->getRequest()->getPost()) { $result = $this->save($IdentityCodesform); $this->view->msgarray = $result; } }