public function editAction() { $db = new Other_Model_DbTable_DbVillage(); if ($this->getRequest()->isPost()) { $_data = $this->getRequest()->getPost(); try { $db->addVillage($_data); Application_Form_FrmMessage::Sucessfull($this->tr->translate('EDIT_SUCCESS'), self::REDIRECT_URL . '/village/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->getVillageById($id); $this->view->row = $row; if (empty($row)) { $this->_redirect('other/village'); } $fm = new Other_Form_FrmVillage(); $frm = $fm->FrmAddVillage($row); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_village = $frm; $db = new Application_Model_DbTable_DbGlobal(); $this->view->district = $db->getAllDistricts(); $this->view->commune_name = $db->getCommune(); }
public function editAction() { $db = new Other_Model_DbTable_DbVillage(); if ($this->getRequest()->isPost()) { $_data = $this->getRequest()->getPost(); try { $db->addVillage($_data); Application_Form_FrmMessage::Sucessfull("ការបញ្ចូលជោគជ័យ !", '/other/Village'); } catch (Exception $e) { Application_Form_FrmMessage::message("ការបញ្ចូលមិនជោគជ័យ"); $err = $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $id = $this->getRequest()->getParam("id"); $row = $db->getVillageById($id); $this->view->row = $row; if (empty($row)) { $this->_redirect('other/Village'); } $fm = new Other_Form_FrmVillage(); $frm = $fm->FrmAddVillage($row); Application_Model_Decorator::removeAllDecorator($frm); $this->view->frm_village = $frm; $db = new Application_Model_DbTable_DbGlobal(); $this->view->district = $db->getAllDistricts(); $this->view->commune_name = $db->getCommune(); }