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

class Home extends MY_Controller {

	public function index()
	{
		save_current_url(base_url() . 'home/');
		
		if($this->session->userdata('user_type') && ($this->session->userdata('user_type') == SUPERADMIN || $this->session->userdata('user_type') == ADMIN)) {
			$this->lang->load('account_general', get_language());
		
			$data['page_title'] = $this->lang->line('website_name') . ' | ' . $this->lang->line('hf_home');
			
			$this->load->model(array('announcement_model', 'user_model'));
			$data['announcements'] = $this->announcement_model->get_announcement_list();
			
			$this->load->view('home', $data);
		}
		else {
			redirect('login', 'refresh');
		}
	}
}

/* End of file home.php */
/* Location: ./application/controllers/home.php */