<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Admin_home extends CI_Controller {
	public function __construct()
	{
		parent::__construct();
		$this->load->library('loginfunctions');
		//logged out
		if($this->loginfunctions->checkloggedin()===FALSE)
		{
			redirect('Admin/') ;
		}
		else
		{
			$this->load->model('Db_model') ;
			$this->load->library(array('session','encrypt'));
		}
	}
	public function index()
	{
		$this->home();
	}
	public function home()
	{
		if($this->loginfunctions->checkloggedin())
		{
			$data = array(
					'page_name' => 'Home Page' ,
					'user' => $this->encrypt->decode( $this->session->userdata('shop_user') )
					);
			$this->load->view('admin/home_header',$data);
			$this->load->view('admin/menu');
			$this->load->view('admin/home_content',$data);
			$this->load->view('admin/footer');
		}
	}	
}//end class Admin_home