Exemplo n.º 1
0
   function editAction(){
   	$db = new Other_Model_DbTable_DbZone();
	   	if($this->getRequest()->isPost()){
	   		try{
	   			$_data = $this->getRequest()->getPost();
	   			$db->addZone($_data);
	   			Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'),self::REDIRECT_URL.'/zone/index');
	   		}catch(Exception $e){
	   			Application_Form_FrmMessage::message($this->tr->translate('EDIT_FAIL'));
	   			$err =$e->getMessage();
	   			Application_Model_DbTable_DbUserLog::writeMessageError($err);
	   		}
	   	}
	   	$id=$this->getRequest()->getParam('id');
	   	$row = $db->getZoneById($id);
	   	if(empty($row)){
	   		$this->_redirect('/other/zone');
	   	}
	   	$frm = new Other_Form_FrmZone();
	   	$frm_co=$frm->FrmAddZone($row);
	   	Application_Model_Decorator::removeAllDecorator($frm_co);
	   	$this->view->frm_zone = $frm_co;
   }
Exemplo n.º 2
0
 function editAction()
 {
     $db = new Other_Model_DbTable_DbZone();
     if ($this->getRequest()->isPost()) {
         try {
             $_data = $this->getRequest()->getPost();
             $db->addZone($_data);
             Application_Form_FrmMessage::Sucessfull("ការ​កែប្រែ​ជោគ​ជ័យ !", '/other/Zone');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​កែប្រែ​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     $row = $db->getZoneById($id);
     if (empty($row)) {
         $this->_redirect('/other/Zone');
     }
     $frm = new Other_Form_FrmZone();
     $frm_co = $frm->FrmAddZone($row);
     Application_Model_Decorator::removeAllDecorator($frm_co);
     $this->view->frm_zone = $frm_co;
 }