Exemplo n.º 1
0
 public function editAction()
 {
     $id = $this->getRequest()->getParam('id');
     $db = new Other_Model_DbTable_DbCommune();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         //print_r($_data);exit();
         try {
             $db->addCommune($_data, $id);
             Application_Form_FrmMessage::Sucessfull($this->tr->translate("EDIT_SUCCESS"), self::REDIRECT_URL . '/commune/');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message($this->tr->translate("EDIT_FAIL"));
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $row = $db->getCommuneById($id);
     $this->view->row = $row;
     $fm = new Other_Form_FrmCommune();
     $frm = $fm->FrmAddCommune($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_commune = $frm;
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->district = $db->getAllDistricts();
 }
Exemplo n.º 2
0
 public function editAction()
 {
     $db = new Other_Model_DbTable_DbCommune();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             $db->addCommune($_data);
             Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !", '/other/Commune/add');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     $row = $db->getCommuneById($id);
     $this->view->row = $row;
     $fm = new Other_Form_FrmCommune();
     $frm = $fm->FrmAddCommune($row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_commune = $frm;
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->district = $db->getAllDistricts();
 }