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

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

  $old_dol_id = $_GET['dol_id'];

  $query = "SELECT * FROM `tbl_dolzhnost` WHERE `dol_id`='".$_GET['dol_id']."' ";
  $result = mysql_query($query);
  if(!$result) puterror2($TEXT['error-tbl6']);
   $result2 = mysql_fetch_array($result);
      $dolzhnost = $result2['dolzhnost'];
         $position = $result2['position'];

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['post-dol']; ?></td><td class="useraddedit"><input size=30 maxlength=120 class="inputmandatory" type=text name=dolzhnost value='<?php echo $dolzhnost; ?>'></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['post-pos']; ?></td><td class="useraddedit"><input size=5 maxlength=5 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=dol_id value='<?php echo $old_dol_id; ?>'>
</td></tr>
</table>
</form>
<?php
  require_once "../util/bottom.php";
?>