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

class Home extends MY_Controller
{

	 public $data = array(
		'breadcrumb'    => 'Home',
        'modul'         => 'Home',
        'pesan'         => '',
        'pagination'    => '',
        'tabel_data'    => '',
        'main_view'     => 'home/home',
        'form_action'   => '',
        'form_value'    => '',
    );
	
	public function __construct()
	{	
		parent::__construct();		
		$this->load->model('Login_model', 'userSession', TRUE);
		$this->load->model('Customer_model', 'customer', TRUE);
		$this->load->library('session');
	}

	public function index()
    {
		if($this->session->userdata('login')) 
		{
		    $session_data = $this->session->userdata('full_name');
		    $session_role = $this->session->userdata('role_id');
		    $session_user = $this->session->userdata('username');
		    
		    
		    $this->data['full_name'] = $session_data; 	
		    $this->data['role_id'] = $session_role; 
		    $this->data['username'] = $session_user; 
		    $this->data['count_customer'] = $this->customer->allcustomer_count();	
		    	          
		    $this->load->view('template',$this->data);
		}	 
	}

}