public function editAction() { if ($this->getRequest()->isPost()) { $_data = $this->getRequest()->getPost(); $db = new Menu_Model_DbTable_DbItem(); try { $db->updateMenuItem($_data); if (!empty($_data['SAVE_CLOSE'])) { Application_Form_FrmMessage::message('កាកែរប្រែបានជោគជ័យ'); } else { Application_Form_FrmMessage::Sucessfull('កាកែរប្រែបានជោគជ័យ', self::REDIRECT_URL . 'item/add'); } } catch (Exception $e) { Application_Form_FrmMessage::message("កាកែរប្រែមិនបានជោគជ័យ"); $err = $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $id = $this->getRequest()->getParam("id"); $db_combo_type = new Menu_Model_DbTable_DbItem(); $row = $db_combo_type->editAllRowItem($id); $this->view->rows = $row; $frm = new Menu_Form_FrmMenuItem(); $this->view->form = $frm->FrmMenu($row); }
public function editAction() { if ($this->getRequest()->isPost()) { $_data = $this->getRequest()->getPost(); $db = new Menu_Model_DbTable_DbItem(); try { if (isset($_data['btnsave'])) { $db->updateMenuItem($_data); Application_Form_FrmMessage::Sucessfull('ការបញ្ចូលជោគជ័យ', self::REDIRECT_URL . '/item/index'); } } catch (Exception $e) { Application_Form_FrmMessage::message("កាកែរប្រែមិនបានជោគជ័យ"); $err = $e->getMessage(); Application_Model_DbTable_DbUserLog::writeMessageError($err); } } $id = $this->getRequest()->getParam("id"); $db_combo_type = new Menu_Model_DbTable_DbItem(); $row = $db_combo_type->editAllRowItem($id); $this->view->photo = $row['img_name']; $this->view->rows = $row; $frm = new Menu_Form_FrmMenuItem(); $this->view->form = $frm->FrmMenu($row); }