<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH.'modules/generic/controllers/Generic.php';

class Errors extends Generic{
	
	function __construct() {
		parent::__construct();
		$this->load->model('Mdl_errors');
	}

	/*
	**	404 Error Page 
	*/
	function index(){
		if(Modules::run('security/isAdmin')){
      $data['isAdmin'] = 'YES';
		}else{
			$data['isAdmin'] = 'NO';
		}
		
		$data['viewFile'] = '404';
		$template = 'errors';
		$data['module'] = "errors";
		echo Modules::run('template/'.$template, $data); 
	}

	/*
	**	Record Not Found Error Page 
	*/
	function recordNotFound(){
		if(Modules::run('security/isAdmin')){
      $data['isAdmin'] = 'YES';
		}else{
			$data['isAdmin'] = 'NO';
		}
		
		$data['viewFile'] = 'not-found';
		$template = 'errors';
		$data['module'] = "errors";
		echo Modules::run('template/'.$template, $data); 	
	}
}

