コード例 #1
0
ファイル: PositionController.php プロジェクト: samlanh/lnms
   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;
		   	
   }
コード例 #2
0
ファイル: DepartmentController.php プロジェクト: samlanh/lnms
   function getpositionAction(){
   	
			   	 $db=new Other_Model_DbTable_DbMyPosition();
			     $rows=$db->getallPosition();
   	             $this->view->list=$rows;
   }