<?php
  ///////////////////////////////////////////////////
  //2010 (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['marsh-edit'];
  $helppage = $TEXT['supp-mar-help2'];

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

  if(empty($_GET['mar_id'])) puterror2($TEXT['error-marsh16']);
  if(strlen($_GET['mar_id'])>11) puterror2($TEXT['error-marsh13']);
  $_GET['mar_id'] = rep($_GET['mar_id']);

  $old_mar_id = $_GET['mar_id'];

  $query = "SELECT * FROM `tbl_marsh` WHERE `mar_id`='".$_GET['mar_id']."' ";
  $result = mysql_query($query);
  if(!$result) puterror2($TEXT['error-tbl42']);
   $result_mar = mysql_fetch_array($result);
         $mar = $result_mar['mar_name'];
         $position = $result_mar['position'];

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['supp-mar2']; ?></td><td class="useraddedit"><input size=30 maxlength=200 class="inputmandatory" type=text name=marsh value='<?php echo $mar; ?>'></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['nd-field10']; ?></td><td class="useraddedit"><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=mar_id value='<?php echo $old_mar_id; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../util/bottom.php";
?>