<?php
#-----------------------------------------------------#
#          ********* ROTORCMS *********               #
#              Made by  :  VANTUZ                     #
#               E-mail  :  visavi.net@mail.ru         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#        для его дальнейшего распространения          #
#-----------------------------------------------------#	
require_once ('../includes/start.php');
require_once ('../includes/functions.php');
require_once ('../includes/header.php');

if (isset($_GET['error'])) {
    $error = intval($_GET['error']);
} else {
    $error = '';
} 

switch ($error):
# ###########################################################################################
# #                                       Ошибка 403                                       ##
# ###########################################################################################
case '403':

    DB :: $dbh -> query("INSERT INTO error (error_num, error_request, error_referer, error_username, error_ip, error_brow, error_time) VALUES (?, ?, ?, ?, ?, ?, ?);", array(403, $request_uri, $http_referer, $username, $ip, $brow, SITETIME));

    DB :: $dbh -> query("DELETE FROM error WHERE error_num=? AND error_time < (SELECT MIN(error_time) FROM (SELECT error_time FROM error WHERE error_num=? ORDER BY error_time DESC LIMIT " . $config['maxlogdat'] . ") AS del);", array(403, 403));

    $_SESSION['note'] = 'ERROR 403. Недопустимый запрос!';
    break;
# ###########################################################################################
# #                                       Ошибка 403                                       ##
# ###########################################################################################
case '404':

    DB :: $dbh -> query("INSERT INTO error (error_num, error_request, error_referer, error_username, error_ip, error_brow, error_time) VALUES (?, ?, ?, ?, ?, ?, ?);", array(404, $request_uri, $http_referer, $username, $ip, $brow, SITETIME));

    DB :: $dbh -> query("DELETE FROM error WHERE error_num=? AND error_time < (SELECT MIN(error_time) FROM (SELECT error_time FROM error WHERE error_num=? ORDER BY error_time DESC LIMIT " . $config['maxlogdat'] . ") AS del);", array(404, 404));

    $_SESSION['note'] = 'ERROR 404. Извините, но такой страницы не существует!';
    break;

    endswitch;

    header ("Location: " . $config['home'] . "/index.php?" . SID);
    exit;

    ?>