Example #1
0
 function editAction()
 {
     $db = new Other_Model_DbTable_DbHoliday();
     //$db->deleteHoliday();
     $db = new Other_Model_DbTable_DbHoliday();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             $_major_id = $db->addHoliday($_data);
             Application_Form_FrmMessage::Sucessfull($this->tr->translate("EDIT_SUCCESS"), self::REDIRECT_URL . '/holiday/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->getHolidayById($id);
     if (empty($row)) {
         $this->_redirect('/other/holiday');
     }
     $frm = new Other_Form_FrmHoliday();
     $frm_holiday = $frm->FrmAddHoliday($row);
     Application_Model_Decorator::removeAllDecorator($frm_holiday);
     $this->view->frm_holiday = $frm_holiday;
 }
Example #2
0
 function editAction()
 {
     $db = new Other_Model_DbTable_DbHoliday();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         try {
             $_major_id = $db->addHoliday($_data);
             Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !", '/other/Holiday');
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam('id');
     $row = $db->getHolidayById($id);
     if (empty($row)) {
         $this->_redirect('/other/Holiday');
     }
     $frm = new Other_Form_FrmHoliday();
     $frm_holiday = $frm->FrmAddHoliday($row);
     Application_Model_Decorator::removeAllDecorator($frm_holiday);
     $this->view->frm_holiday = $frm_holiday;
 }