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; }
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; }