Beispiel #1
0
 public function indexAction()
 {
     $db = new product_Model_DbTable_DbProduct();
     $db_global = new saleorder_Model_DbTable_DbSaleOrder();
     $itemRows = $db_global->getProductOption();
     $this->view->itemsOption = $itemRows;
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         if (isset($data['search'])) {
             $search = array('advance_search' => $data['txt_search'], 'pro_id' => $data['add_item'], 'cate_id' => $data['cat_id'], 'brand' => $data['brand']);
         } elseif (isset($data['status'])) {
             $ids = $data['status'];
             $db->updateUnStatus($ids);
             $this->_redirect("/product/");
         } elseif (isset($data['unstatus'])) {
             $ids = $data['unstatus'];
             $db->updateStatus($ids);
             $this->_redirect("/product/");
         }
         /*$id = $data['checkBox'];
         		if(isset($data['update'])&& $id !=""){
         			$this->_redirect("/product/index/edit/id/".$id);
         		}elseif(isset($data['delete'])&& $id !=""){
         			$db->deleteCat($id);
         			Application_Form_FrmMessage::message("កាលុបប្រភេទអ្នកប្រើប្រាស់បានជោគជ័យ");
         			Application_Form_FrmMessage::redirectUrl('/product/');
         		}else { $this->_redirect("/product/");}*/
     } else {
         $search = array('advance_search' => '', 'pro_id' => -1, 'cate_id' => -1, 'brand' => -1);
     }
     $datas = $db->getAllProduct($search);
     $this->view->getdata = $datas;
     $frm = new product_Form_Frmproduct();
     $this->view->frmSearch = $frm->frmSearch();
 }