Exemplo n.º 1
0
 public function editAction()
 {
     $id = $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : '0';
     $db = new phurchase_Model_DbTable_DbOrder();
     $itemRows = $db->selectProductOption();
     $this->view->items = $itemRows;
     $orderDetail = $db->getSalesOderID($id);
     $this->view->rowsOrder = $orderDetail;
     $itemRowsGet = $db->getProductOption();
     $this->view->itemsOption = $itemRowsGet;
     $data = $db->getPhurchase($id);
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         //print_r($data);exit();
         if (isset($data['save'])) {
             $db->updatCat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/product/index/edit/id/' . $id);
         } elseif (isset($data['save_add'])) {
             $db->updatCat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/product/index/add');
         } elseif (isset($data['save_close'])) {
             $db->updatCat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/product');
         }
     }
     $form = new phurchase_Form_FrmPhurchaseOrder();
     $this->view->frmcate = $form->FrmProCate($data);
 }