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

function server_down_error(){
    $_this = &get_instance();
    $user_data = $_this->user_data;
    
    $head = array(
        'title'     => 'Unavailable operation!',
        'menu'      => 'home',
        'user_data' => $user_data,
    );
    
    $data = array(
        'title'     => $head['title'],
        'error'     => $_this->session->userdata('error_message'),
        
    );
    
    $head   = $_this->load->view('templates/head', $head, TRUE);
    //$header = $_this->load->view('templates/header', $header, TRUE);
    $html   = $_this->load->view('error_pages/server_down', $data, TRUE);
    $footer = $_this->load->view('templates/footer', '', TRUE);
    echo $head . $header . $html . $footer;
    exit(0);
}

function scan_unavailable_error(){
    $_this = &get_instance();
    $user_data = $_this->user_data;
    
    $head = array(
        'title'     => '404 - Page Not Found!',
        'menu'      => 'home',
        'user_data' => $user_data,
    );
    
    $data = array(
        'title'     => $head['title'],
        'error'     => $_this->session->userdata('error_message'),
        
    );
    
    $head   = $_this->load->view('templates/head', $head, TRUE);
    //$header = $_this->load->view('templates/header', $header, TRUE);
    $html   = $_this->load->view('error_pages/scan_unavailable', $data, TRUE);
    $footer = $_this->load->view('templates/footer', '', TRUE);
    echo $head . $header . $html . $footer;
    exit(0);
}

function show_403_error() {
    $_this = &get_instance();
    $head = array();
    $head['page_title'] = '403 - Access Forbidden';
    
    $header = array();
    $user_data = array();
    $user_data = $_this->user_data;
    $header['user_data'] = $user_data;
    $header['menu'] = 'home';
    
    $data = array();
    $data['error'] = $_this->session->userdata('error_message');
    
    $head = $_this->load->view('templates/head', $head, TRUE);
    $header = $_this->load->view('templates/header', $header, TRUE);
    $html = $_this->load->view('error_pages/403', $data, TRUE);
    $footer = $_this->load->view('templates/footer', '', TRUE);
    echo $head . $header . $html . $footer;
    exit(0);
}

function show_404_error() {
    $_this = &get_instance();
    $head = array();
    $head['page_title'] = '404 - Page Not Found';
    
    $header = array();
    $user_data = array();
    $user_data = $_this->user_data;
    $header['user_data'] = $user_data;
    $header['menu'] = 'home';
    
    $data = array();
    $data['error'] = $_this->session->userdata('error_message');
    
    echo $_this->load->view('templates/head', $head, TRUE);
    echo $_this->load->view('templates/header', $header, TRUE);
    echo $_this->load->view('error_pages/404', $data, TRUE);
    echo $_this->load->view('templates/footer', '', TRUE);
    exit(0);
}

function show_400_error() {
    $_this = &get_instance();
    $head = array();
    $head['page_title'] = '400 - Bad Request';
    
    $header = array();
    $user_data = array();
    $user_data = $_this->user_data;
    $header['user_data'] = $user_data;
    $header['menu'] = 'home';
    
    echo $_this->load->view('templates/head', $head, TRUE);
    echo $_this->load->view('templates/header', $header, TRUE);
    echo $_this->load->view('error_pages/400', '', TRUE);
    echo $_this->load->view('templates/footer', '', TRUE);
    exit(0);
}
?>