<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Search extends CI_Controller {


	private $cart_qty   = '' ;
	private $logged 	= 0  ;	
	private $user 		= '' ;
	
	public function __construct()
	{
		parent::__construct();
		
		$this->load->library('loginfunctions');
		
		$this->load->model('Db_model');
		
		$this->load->library(array('form_validation'));
		
		$this->load->library('cart');
		
		$this->load->library("pagination");
		
		$this->load->helper('basic_helper');
		$ic=0;
		foreach ($this->cart->contents() as $items):
		$ic++;
		
		endforeach;
		$this->cart_qty = ''.$ic.'';
		
		if($this->session->userdata('shop_user2'))
		{
			$this->load->library('encrypt') ;
			$this->user = $this->encrypt->decode($this->session->userdata('shop_user2'));
			$this->logged = 1;
		}
		
	}
	
	
	
	
	
	
	public function index()
	{
		
		
		
		$config = array();
        $config["base_url"] = base_url() . "shop_product";
        $config["total_rows"] = $this->Db_model->get_count();
        $config["per_page"] = 3;
        $config["uri_segment"] = 2;

        $this->pagination->initialize($config);

        $page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;

        $data["links"] = $this->pagination->create_links();

        $data['allproduct'] = $this->Db_model->get_authors('shop_product',$config["per_page"], $page);

      //  $this->load->view('authors/index', $data);
		
		
		
//$data['allproduct']= $this->Db_model->get_where_by_order('shop_product',array('active'=>'Y'),'order','asc') ;
		
		
		
		$this->load->view('website/header',$data);
        $this->load->view('website/menu',$data);
		$this->load->view('website/search',$data);
        $this->load->view('website/footer');
	}












	
	

}
