<?php
	defined('BASEPATH') OR exit('No direct script access allowed');
	class Admin_Controller extends CI_Controller {

		public $data = array();

		public function __construct(){
			parent::__construct();

			$this->load->helper('form');
			$this->load->helper('file');
			$this->load->library('form_validation');
			$this->load->library('session');


			$this->load->model('admin_model', 'admin_user');
			$this->load->model('hc_logs_model', 'logs');

			$exception_uris = array($this->config->item('admin_folder').'/login', $this->config->item('admin_folder').'/logout', $this->config->item('admin_folder').'/verify-email');

			if(in_array(uri_string(), $exception_uris) === FALSE){
				if($this->admin_user->loggedin() === FALSE){
					redirect(base_url().$this->config->item('admin_folder').'/login');
				}
			}


			$this->data["admin_modules"] = $this->admin_user->get_admin_sidebar();

		}
	}
?>