<?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['supp-vazh-title3'];
  $helppage = $TEXT['supp-vazh-help3'];

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

  if(strlen($_GET['vazh_id'])>11) puterror2($TEXT['error-vazh4']);
  $_GET['vazh_id'] = rep($_GET['vazh_id']);

  $old_vazh_id = $_GET['vazh_id'];

  $query = "SELECT * FROM `tbl_supp_srochnost` WHERE `sroch_id`='".$_GET['vazh_id']."' ";
  $result = mysql_query($query);
  if (!$result) puterror2($TEXT['error-tbl24']);
   $result2 = mysql_fetch_array($result);
         $srochnost = $result2['srochnost'];
         $position = $result2['position'];
         $old_photo = $result2['pic_sr'];
	if(!empty($result2['pic_sr'])) $picture = "<img alt='картинка' width='16' height='16' align='absmiddle' src='../".$result2['pic_sr']."' />";
	  else $picture = $TEXT['res-field17'];

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['inst-field1']; ?></td><td class="useraddedit" align=center><?php echo $picture; ?></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['inst-field6']; ?></td><td><input type=file name=photo></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['analiz-msg-text']; ?></td><td><input size=30 maxlength=200 class="inputmandatory" type=text name=srochnost value='<?php echo $srochnost; ?>'></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['nd-field10']; ?></td><td><input size=5 maxlength=11 class="inputmandatory" type=text name=position value='<?php echo $position; ?>'></td></tr>
<tr><td></td><td>
<input class=button type=submit value='<?php echo $button; ?>' />
<input type=hidden name=vazh_id value='<?php echo $old_vazh_id; ?>' />
<input type=hidden name=old_photo value='<?php echo $old_photo; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../util/bottom.php";
?>