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

class Terms_and_conditions extends CI_Controller {


	private $cart_qty   = '' ;
	private $logged 	= 0  ;	
	private $user 		= '' ;
	
	public function __construct()
	{
		parent::__construct();
		
		$this->load->model('Db_model');
		
		$this->load->library('cart');
		
		$this->load->helper('basic_helper');
		
		$ic=0;
		foreach ($this->cart->contents() as $items):
		$ic++;
		endforeach;
		$this->cart_qty = ''.$ic.'';
		//$this->cart_qty = ''.$this->cart->total_items().'';
		
		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()
	{
		$this->views() ;
	}
	
	
	
	public function views()
	{
		
		
		$data['result'] = array() ;
		$data['details']=array();
		$data['cart_qty'] = $this->cart_qty;
		$data['email'] = $this->user;
		$data['logged'] = $this->logged;
		$data['page'] = 'terms_and_conditions' ;
		$data['title'] = 'Terms & Conditions' ;
		$data['result'] = $this->Db_model->get_where_by_order('shop_category',array(),'order','asc') ;
		$data['about'] = $this->Db_model->get_where_by_order('shop_pages',array('type'=>'about','active'=>'Y'),'order','desc') ;
		$data['contactus'] = $this->Db_model->get_where_by_order('shop_contact',array('status'=>'1'),'id','desc') ;
		$product = $this->Db_model->get_all_by_order('shop_product','order','asc') ;
		if($product!==FALSE)
		{
			$data['product'] = $product;
		}
		
		$data['category']=$data['offer'] = $this->Db_model->get_all_by_order('shop_category','order','asc');
		
		$data['details1'] = $this->Db_model->get_where_by_order('shop_pages',array('active'=>'Y','type'=>'terms_and_conditions'),'order','asc') ;
		
		$details = $this->Db_model->get_where_by_order('shop_pages',array('active'=>'Y','type'=>'about'),'order','asc') ;
		
		if($details!==FALSE)
		{
			$data['details'] = $details ;
		}
		
	
		//$this->load->view('website/base_header');
		//$this->load->view('website/menu',$data);
		//$this->load->view('website/about',$data);
		//$this->load->view('website/right');
		//$this->load->view('website/footer');
		$this->load->view('website/header',$data);
	
		$this->load->view('website/menu',$data);
		$this->load->view('website/terms_and_conditions',$data);
		$this->load->view('website/footer');
	}
	

	
}
