<?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['org-title'];
  $helppage = $TEXT['org-help'];

  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['org-title'];
  if(!isset($button)) $button = $TEXT['btn_add'];
  if(!isset($action)) $action = "add.php";
  if(!isset($showhide)) $visible = "checked";

  $query_iskh = "SELECT MAX(position) AS position FROM `tbl_organizaciya`";
     $result_iskh = mysql_query($query_iskh);
     if(!$result_iskh) puterror2($TEXT['error-tbl7']);
     $result_iskh2 = mysql_fetch_array($result_iskh);
     $pos = $result_iskh2['position']+1;

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class=useraddedit><?php echo $TEXT['org-field1']; ?></td><td class=useraddedit><input size=30 maxlength=100 class=inputmandatory type=text name=organizaciya /></td></tr>
<tr><td class=useraddedit><?php echo $TEXT['tbl-position']; ?></td><td class=useraddedit><input size=5 maxlength=5 class=inputmandatory type=text name=position value="<?php echo $pos; ?>" /></td></tr>
<tr><td class=useraddedit><?php echo $TEXT['global-visible']; ?></td><td><input type=checkbox name=visible <?php echo $visible; ?> /></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";
?>