<?php
  ///////////////////////////////////////////////////
  //Карпухин Павел
  //2010 (С)
  ///////////////////////////////////////////////////

  $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['krit-title2'];
  $helppage = $TEXT['krit-help2'];

  require_once "../config.php";
  require_once "../util/top_layer1.php";

  if(!isset($title)) $title = $TEXT['krit-title2'];
  if(!isset($button)) $button = $TEXT['btn_add'];
  if(!isset($action)) $action = "add.php";
  if(!isset($showhide)) $visible = "checked";

  if($result2['user'] == 1) puterror2($TEXT['error-loginform4']);
  if($result2['master'] == 1) puterror2($TEXT['error-loginform4']);
  if($result2['manager'] == 1) puterror2($TEXT['error-loginform4']);

$query_pos = "SELECT MAX(position) AS max_pos FROM `tbl_kritichnost` ";
  $result_pos = mysql_query($query_pos);
    if(!$result_pos) puterror2($TEXT['error-tbl8']);
     $pos = mysql_fetch_array($result_pos);
     $position = $pos['max_pos'] + 5;

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['menu-btn32']; ?></td><td class="useraddedit"><input size=30 maxlength=255 class="inputmandatory" type=text name=kritichnost /></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['tbl-position']; ?></td><td class="useraddedit"><input size=3 maxlength=11 class="inputmandatory" type=text name=position value="<?php echo $position; ?>" /></td></tr>
<tr><td class="useraddedit"><?php echo $TEXT['inst-field1']; ?></td><td class="useraddedit"><input type=file name=photo></td></tr>
<tr><td></td><td><input class="button" type=submit value='<?php echo $button; ?>'></td></tr>
</table>
</form>
<?php
  require_once "../util/bottom.php";
?>