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