예제 #1
0
	public function editAction(){
		$db_district = new Other_Model_DbTable_DbDistrict();
		if($this->getRequest()->isPost()){
			$_data = $this->getRequest()->getPost();
			try{
				$db_district->addDistrict($_data);
				Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'),self::REDIRECT_URL . '/District/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_district->getDistrictById($id);
		if(empty($row)){
			$this->_redirect('other/District');
		}
		$fm = new Other_Form_FrmDistrict();
		$frm = $fm->FrmAddDistrict($row);
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_district = $frm;
	}
예제 #2
0
 public function editAction()
 {
     $db_district = new Other_Model_DbTable_DbDistrict();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             $db_district->addDistrict($_data);
             Application_Form_FrmMessage::Sucessfull("ការកែប្រែ​ជោគ​ជ័យ !", '/other/District');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការកែប្រែ​​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam("id");
     $row = $db_district->getDistrictById($id);
     if (empty($row)) {
         $this->_redirect('other/District');
     }
     $fm = new Other_Form_FrmDistrict();
     $frm = $fm->FrmAddDistrict($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_district = $frm;
 }