<?php
	defined('BASEPATH') or exit('No direct script access allowed');
	
	class Home extends CI_Controller
	{
		public function __construct()
		{
			parent::__construct();
			// cek_tabel();
			cek_session_login();
			$this->perPage = 10; 
			$this->title = info()['title']; 
			$this->iduser = $this->session->idu; 
			$this->level = $this->session->level; 
			$this->akses = $this->session->type_akses; 
			
		}
		
		public function index()
		{
			cek_crud_akses(8);
			$this->template->set('title', 'Dashboard | '.$this->title);
			close_session_for_readonly();
			if($this->level=='desain'){
				$html = $this->template->load('main/themes','main/dashboard_desain', array(), TRUE);
			}elseif($this->level=='operator'){
				$html = $this->template->load('main/themes','main/dashboard_operator', array(), TRUE);
				}else{
				$html = $this->template->load('main/themes','main/dashboard', array(), TRUE);
			}
			output_query_profile_headers('home-dashboard');
			$this->output->set_output($html);
		}
		
		public function account()
		{
			cek_crud_akses(8);
			$this->template->set('title', 'Account Demo | '.$this->title);
			$this->template->load('main/themes','main/account');
		}
		
	}				
