<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Utama extends CI_Controller {
	 
	function __construct(){
	error_reporting(0);
		parent::__construct();		
			$this->load->library('session');
			$this->load->library('form_validation');
			$this->load->model('m_login');						
			$this->load->model('m_kategori');						
			$this->load->model('m_home');	
			$this->load->model('m_laporan');	
			if($this->session->userdata('token') !=md5(md5(md5(date('Ymd').'tamu')))){
				redirect(base_url("home"));
			}			
			
		}
	
	function index(){	
		//tamu hari ini 
		$tm =  $this->m_laporan->tamuhariini();
		$tb =  $this->m_laporan->tamubulanini();
		$tt =  $this->m_laporan->tamutahunini();
		$data['tm'] =$tm;
		$data['tb'] = $tb;
		$data['tt'] = $tt;
		$data['alert'] = '';
		$data['pesan'] = '';		
		$data['judul'] = 'Dashboard';
		$this->load->view('admin/utama', $data);		
	}

	function keluar(){	
	session_destroy();
	redirect(base_url("home"));
	}
	
}

	
