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

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

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

  if(strlen($_POST['vazh_id'])>11) puterror2($TEXT['error-vazh4']);
  if(strlen($_POST['zay_id'])>11) puterror2($TEXT['error-inst7']);
  if(strlen($_POST['old_vazh_id'])>11) puterror2($TEXT['error-vazh4']);
  $_POST['vazh_id'] = rep($_POST['vazh_id']);
  $_POST['zay_id'] = rep($_POST['zay_id']);
  $_POST['old_vazh_id'] = rep($_POST['old_vazh_id']);

    $query = "UPDATE `tbl_supp_zayavka` SET `sroch_id` = '".$_POST['vazh_id']."' WHERE `zay_id`='".$_POST['zay_id']."' ";
       if(mysql_query($query))
         {
         echo "<html><head>
               <meta HTTP-EQUIV='Refresh' CONTENT='0; URL=deleteform-vazh.php?vazh_id=".$_POST['old_vazh_id']."' />
               </head></html>";
         } else puterror2($TEXT['error-association']);
  require_once "../util/bottom.php";
?>
