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);
 }
Пример #2
0
 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);
 }