<?php
  ///////////////////////////////////////////////////
  //2007 (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['usr-title5'];
  $helppage = "";

  require_once "../config.php";
  require_once "../util/top.php";

  if($result2['master'] == 1) puterror2($TEXT['error-loginform4']);
  if($result2['manager'] == 1) puterror2($TEXT['error-loginform4']);

  if(empty($_GET['user_id'])) puterror2($TEXT['error-user6']);
  if(strlen($_GET['user_id'])>11) puterror2($TEXT['error-user2']);
  if(strlen($_GET['big'])>1) puterror2($TEXT['usr-big-err']);
  if(strlen($_GET['org'])>400) puterror2($TEXT['error-org4']);
  if(strlen($_GET['upr'])>400) puterror2($TEXT['error-upr4']);
  if(strlen($_GET['otd'])>280) puterror2($TEXT['error-otd3']);
  $_GET['org'] = rep($_GET['org']);
  $_GET['upr'] = rep($_GET['upr']);
  $_GET['otd'] = rep($_GET['otd']);

  $query = "UPDATE `tbl_users` SET `visible`='hide' WHERE `user_id`='".$_GET['user_id']."' ";
  if(mysql_query($query))
  {
    echo "<html><head>
          <meta HTTP-EQUIV='Refresh' CONTENT='0; URL=index.php?user_id=".$_GET['user_id']."&amp;org=".$_GET['org']."&amp;upr=".$_GET['upr']."&amp;otd=".$_GET['otd']."&amp;big=".$_GET['big']."' />
          </head></html>";
  } else puterror2($TEXT['error-user10']);
  require_once "../util/bottom.php";
?>
