public function addAction()
 {
     $form = new phurchase_Form_FrmPhurchaseOrder();
     $this->view->frmcate = $form->FrmProCate();
     $formven = new phurchase_Form_FrmVendor();
     $this->view->frmcatevendor = $formven->FrmProCate();
     $items = new phurchase_Model_DbTable_DbOrder();
     $itemRows = $items->selectProductOption();
     $this->view->items = $itemRows;
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         //print_r($data);exit();
         $payment_purchase_order = new phurchase_Model_DbTable_DbOrder();
         if (isset($data['save'])) {
             $payment_purchase_order->vendorPurchaseOrderPayment($data);
             Application_Form_FrmMessage::message("ការបញ្ចូលបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/phurchase/order/add');
         } elseif (isset($data['save_close'])) {
             $payment_purchase_order->vendorPurchaseOrderPayment($data);
             Application_Form_FrmMessage::message("ការបញ្ចូលបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/phurchase/order');
         } else {
             Application_Form_FrmMessage::message("ការបញ្ចូលបរាជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/phurchase/order');
         }
     }
 }
 public function editAction()
 {
     $id = $this->getRequest()->getParam("id");
     $db = new phurchase_Model_DbTable_DbVendor();
     $data = $db->getCateById($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('/phurchase/vendor/edit/id/' . $id);
         } elseif (isset($data['save_add'])) {
             $db->updatCat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/phurchase/vendor/add');
         } elseif (isset($data['save_close'])) {
             $db->updatCat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/phurchase/vendor');
         }
     }
     $form = new phurchase_Form_FrmVendor();
     $this->view->frmcate = $form->FrmProCate($data);
 }