<?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['new-title2'];
  $helppage = "";

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

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

  if(empty($_GET['razd_id'])) puterror2($TEXT['error-nd16']);
  if(strlen($_GET['razd_id'])>11) puterror2($TEXT['error-nd13']);
  if(empty($_GET['doc_id'])) puterror2($TEXT['error-nd17']);
  if(strlen($_GET['doc_id'])>11) puterror2($TEXT['error-nd18']);
  $_GET['razd_id'] = rep($_GET['razd_id']);
  $_GET['doc_id'] = rep($_GET['doc_id']);

  $query = "UPDATE `tbl_documents` SET `visible`='show' WHERE `razd_id`='".$_GET['razd_id']."' AND `doc_id`='".$_GET['doc_id']."' ";
  if(mysql_query($query))
  {
    echo "<html><head>
          <meta HTTP-EQUIV='Refresh' CONTENT='0; URL=docindex.php?razd_id=".$_GET['razd_id']."' />
          </head></html>";
  } else puterror2($TEXT['error-nd28']);
  require_once "../util/bottom.php";
?>
