<?php
  ///////////////////////////////////////////////////
  //Выключение ip-адреса из статистики
  //2010 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if (is_file ("lang/".$lang."/".$lang.".php")) include "lang/".$lang."/".$lang.".php";
     else include "lang/ru/ru.php";

  $title=$titlepage = $TEXT['addr-title-edit'];

  require_once "config.php";
  require_once "utils/functions.php";
  require_once "utils/top.php";

  if($result2['administrator'] == 0 && $result2['user'] == 0) {puterror2($result2['skin'],$TEXT['error-loginform2']); require_once "utils/bottom.php"; exit();}

  if(empty($_GET['ip_id'])) {puterror2($result2['skin'],$TEXT['error-addr21']); require_once "utils/bottom.php"; exit();}
  if(strlen($_GET['ip_id'])>255) {puterror2($result2['skin'],$TEXT['error-addr22']); require_once "utils/bottom.php"; exit();}
  $_GET['ip_id'] = rep($_GET['ip_id']);

  $query = "UPDATE `tbl_ip` SET `vkl_ip`='0', `state_addr` = '0' WHERE `ip_id`='".$_GET['ip_id']."' ";
  if(mysql_query($query))
  {
    echo "<html><head>
          <meta HTTP-EQUIV='Refresh' CONTENT='0; URL=main.php' />
          </head></html>";
  } else {puterror2($result2['skin'],$TEXT['error-tbl2']); require_once "utils/bottom.php"; exit();}
  require_once "utils/bottom.php";
?>