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

class dashbord extends MY_Controller{
	function __construct(){
        parent::__construct();
        $this->load->model('home_model', '', TRUE);
        $this->load->model('event_model', '', TRUE); 
        $this->load->model('contact_model', '', TRUE);  
        

        // if($this->data['userid']==''){
        //     redirect($this->data['base_url'] . 'home');   
        //     exit;
        // }
    }
    function index(){
        //redirect($this->data['base_url'] . 'category');
        $date= date('d/m/Y h:i');
        $this->smarty->assign('date',$date);
        $this->data['contact'] = $this->contact_model->allcontact_details_withgroupby();
        $this->data['event'] = $this->event_model->allevent_details();
        $this->data['message'] = $this->session->flashdata('message');
        $this->breadcrumb->add('Dashboard', $this->data['base_url']);
        $this->data['breadcrumb'] = $this->breadcrumb->output();
        $this->data['tpl_name']= "dashbord.tpl";
        $this->smarty->assign('data', $this->data);
        $this->smarty->view('template.tpl');  
    }    
}
