コード例 #1
0
 public function addBrandAction()
 {
     $category = new Product_Model_DbTable_DbProduct();
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         //print_r($data);exit();
         $addcategory = $category->addBrand($data);
         Application_Form_FrmMessage::message("Brand Name Has Been Saved !");
         Application_Form_FrmMessage::redirectUrl('/product/index/brand');
     }
     $id = $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : '0';
     if ($id) {
         //view update if get id
         $rows = $category->getBrandName($id);
         $frmcategory = new Application_Form_FrmInclude($rows);
         $frmcate = $frmcategory->addBrand($rows);
         $action = BASE_URL . "/product/index/update-brand";
     } else {
         $frmcategory = new Application_Form_FrmInclude(null);
         $frmcate = $frmcategory->addBrand(null);
         $action = BASE_URL . "/product/index/add-brand";
     }
     Application_Model_Decorator::removeAllDecorator($frmcate);
     $method = "post";
     $url_cancel = BASE_URL . "/product/index/brand";
     $frm = new Application_Form_FrmGlobal();
     $this->view->formVendor = $frm->getForm1($action, $method, $url_cancel, $frmcate, 'MENU_PRODUCT_INDEX_ADD_BRAND');
 }
コード例 #2
0
 public function addTypePriceAction()
 {
     $dbprice = new Product_Model_DbTable_DbPrice();
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         $dbprice->addPriceType($data);
         Application_Form_FrmMessage::message("Price type has been saved! ");
     }
     $id = $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : '0';
     $frm = new Product_Form_FrmItemPrice(null);
     if ($id) {
         $row = $dbprice->getTypePrice($id);
         $frmpricetype = $frm->AddClassPrice($row);
         //Application_Form_FrmMessage::message("Price type has been saved! ");
         $action = BASE_URL . "/product/adjust-stock/update-type-price";
     } else {
         $frmpricetype = $frm->AddClassPrice(null);
         $action = BASE_URL . "/product/adjust-stock/add-type-price";
     }
     Application_Model_Decorator::removeAllDecorator($frmpricetype);
     $method = "post";
     $url_cancel = BASE_URL . "/product/adjust-stock/type-price";
     $frmgenerate = new Application_Form_FrmGlobal();
     $this->view->formVendor = $frmgenerate->getForm1($action, $method, $url_cancel, $frmpricetype, 'TYPE_PRICE');
 }