<?php
class Admin_Controller extends CI_Controller {
	function __construct () {
		parent::__construct ();
		
		if ( ! $this->session->has_userdata ( 'admin_id' ) ) {
			redirect ( 'admin/auth/login', 'refresh' );
		} else {
		    $admin_id = $this->session->userdata( 'admin_id' );
		
    		if ( $admin_id > 0 ) {
    		    
    			$this->load->model ( 'admin/dashboard_model', 'dashboard_model' );
    		
    			$this->admin = $this->dashboard_model->get_admin_detail ( $admin_id );
    			
    		}
		}
	}
}