"products"); public function preDispatch(){ $auth = new Auth(); if($auth->is_login_session() == false)Redirect($this->url.'/admin/auth/'); } public function index() { } public function view($brend_id = 0,$catalog_id = 0) { $this->tpl->assign('brend_id',$brend_id); $this->tpl->assign('catalog_id',$catalog_id); $products = new Products($this->lang); $res = $products->getView($catalog_id,$this->getParam); $this->tpl->assign('products', $res); } public function save($brend_id = 0,$catalog_id = 0, $id = 0){ $filters = new Filters($this->lang); $this->tpl->assign('catalog_id',$catalog_id); $this->tpl->assign('brend_id',$brend_id); $products = new Products($this->lang); if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->error = $products->valid($this->postParam); if(!$this->error){ $products->save($this->postParam,$_FILES); Redirect($this->url.'/admin/products/view/'.$brend_id.'/'.$catalog_id.'/'); } } if($id != null){ $row = $products->getProduct($id); $this->tpl->assign('product', $row); $this->tpl->assign('product_filters',$filters->getProductFilters($id)); } $this->tpl->assign('filters',$filters->getRubrics_tree()); } public function delete($brend_id = 0,$catalog_id = 0,$id = null){ if($id != null){ $products = new Products($this->lang); $products->deleteProduct($id); Redirect($this->url.'/admin/products/view/'.$brend_id.'/'.$catalog_id.'/'); } } } ?>