<?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 = $TEXT['global-work'];

  require_once "../config.php";
  require_once "../util/top.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['size_id'])>2) puterror2($TEXT['error-size6']);
  if(strlen($_POST['res_id'])>11) puterror2($TEXT['error-res11']);
  if(strlen($_POST['old_size_id'])>2) puterror2($TEXT['error-size9']);
  $_POST['size_id'] = rep($_POST['size_id']);
  $_POST['res_id'] = rep($_POST['res_id']);
  $_POST['old_size_id'] = rep($_POST['old_size_id']);

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