<?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['size-title4'];
  $helppage = $TEXT['size-help4'];

  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(!isset($title)) $title = $TEXT['size-title4'];
  if(!isset($button)) $button = $TEXT['btn_edit'];
  if(!isset($action)) $action = "edit.php";

  if(strlen($_GET['size_id'])>2) puterror2($TEXT['error-size6']);
  $_GET['size_id'] = rep($_GET['size_id']);

  $old_size_id = $_GET['size_id'];

  $query = "SELECT * FROM `tbl_sizes` WHERE `size_id`='".$_GET['size_id']."' ";
  $result = mysql_query($query);
  if (!$result) puterror2($TEXT['error-tbl35']);
    $result2 = mysql_fetch_array($result);
         $size_name = $result2['size_name'];

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['size-edit']; ?></td><td class="useraddedit"><input size=30 maxlength=100 class="inputmandatory" type=text name=size_name value='<?php echo $size_name; ?>'></td></tr>
<tr><td></td><td>
<input class="button" type=submit value='<?php echo $button; ?>' />
<input type=hidden name=size_id value='<?php echo $old_size_id; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../util/bottom.php";
?>