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

class Home extends CI_Controller {
	// Session Authoriesed
	public function __construct() {
		parent::__construct();
		
		$admin = $this->session->userdata('staff');
		$column['id'] = $admin['id'];
		$table = 'tbl_user';
		
	    // loading common model
	    $this->load->model('Common_model');
		$result = $this->Common_model->Result($column,$table);
		if($result['password'] == $admin['password']){
		    $login = true;
		} else {
		    $login = false;
		}
		
		if (empty($admin) || $login==false) {
// 			$this->session->set_flashdata('msg','Your Session Has Been Expired');
			redirect(base_url().'staff/login/index');
		}
	}

	public function index()
	{
	    redirect(base_url('staff/dashboard'));
	}
	
}

/* End of file Home.php */
/* Location: ./application/controllers/staff/Home.php */