function editAction(){ $db = new Other_Model_DbTable_DbMyPosition(); if($this->getRequest()->isPost()){ $_data = $this->getRequest()->getPost(); try{ $db->upDatePosition($_data); Application_Form_FrmMessage::Sucessfull("ការបញ្ចូលជោគជ័យ !",'/payroll/position'); }catch(Exception $e){ Application_Form_FrmMessage::message("ការបញ្ចូលមិនជោគជ័យ"); $err =$e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $id = $this->getRequest()->getParam("id");//ចាប់ id from ln_position ; $row = $db->getPositionById($id); if(empty($row)){ $this->_redirect('payroll/co'); } // if(!empty($row['save_new'])){ // Application_Form_FrmMessage::message('ការបញ្ចូលជោគជ័យ'); // }else{ // Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL . '/position/index'); // } $frm = new Other_Form_FrmPosition(); $frm_co=$frm->FrmAddPosition($row); Application_Model_Decorator::removeAllDecorator($frm_co); $this->view->frm_position = $frm_co; }
function getpositionAction(){ $db=new Other_Model_DbTable_DbMyPosition(); $rows=$db->getallPosition(); $this->view->list=$rows; }