public function view_all_categories($parentId, $catId, $page = 0) { $config = getPaginationDesign(); $categories = $this->category_model->getParentCategory($catId); $config["base_url"] = site_url() . '/' . strtolower(__CLASS__) . '/index/' . $parentId . '/' . $catId . '/'; $config["total_rows"] = isset($categories) ? count($categories) : 0; $config["per_page"] = 9; $config["uri_segment"] = 4; $this->pagination->initialize($config); $this->data['categories'] = $this->category_model->getParentCategory($catId, $config["per_page"], $page); $this->data["links"] = $this->pagination->create_links(); $this->data['mainCategoryName'] = $this->category_model->getSingleCategory($catId); $this->render_page('category/view_all_categories', $this->data); }
public function search($skey = '', $page = 0) { $this->load->library("pagination"); $searchString = trim($this->input->post('search')); if (empty($searchString)) { $key = $skey; } else { $key = $searchString; } $this->page_title = $searchString . " | General Tech Services LLC -" . STATIC_TITLE; if ($key) { $this->page_title = $key . " | General Tech Services LLC -" . STATIC_TITLE; $this->current_section = 'Product'; $this->data['breadcrumb'] = '<li><a href="javascript:void(0);"> Search » </a></li>' . '<li><a href="javascript:void(0);" style="color:#d92523;"> ' . $key . '</a></li>'; $config = getPaginationDesign(); $productDetails = $this->home_model->search($key); $config["base_url"] = site_url() . '/' . strtolower(__CLASS__) . '/search/' . $key . '/'; $config["total_rows"] = isset($productDetails['product_details']) ? count($productDetails['product_details']) : 0; $config["per_page"] = 9; $config["uri_segment"] = 4; $this->pagination->initialize($config); $this->data['products'] = $this->home_model->search($key, $config["per_page"], $page); $this->data["links"] = $this->pagination->create_links(); $this->data['catId'] = ''; $this->data['cateName'] = ''; $this->data['key'] = $key; $this->data['subCatId'] = ''; $this->data['parentCateId'] = ''; if (isset($this->data['products']['product_details']['0']['prd_category'])) { $root = $this->category_model->getRootCategory($this->data['products']['product_details']['0']['prd_category']); $this->data['parentCateId'] = isset($root[count($root) - 1]) ? $root[count($root) - 1] : ''; } } else { $this->page_title = "General Tech Services LLC -" . STATIC_TITLE; $this->data['breadcrumb'] = '<li><a href="javascript:void(0);" style="color:#d92523;"> Search » </a></li>'; $this->data['message'] = 'No product found'; } $this->render_page(strtolower(__CLASS__) . '/search', $this->data); }