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

  require_once "../config_a.php";
  require_once "../utils/functions.php";
  require_once "../utils/top_adm.php";

  if($result2['administrator'] == 0) {puterror($result2['skin'],$TEXT['error-loginform2']); require_once "../utils/bottom_adm.php"; exit();}
  $button = $TEXT['btn_add'];
  $action = "add.php";
?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table align="center">
<tr><td class="bold_it_page"><?php echo $TEXT['srv-name']; ?></td>
    <td><select name="srv_id">
    <?php
        $query1 = "SELECT `srv_id`, `name`, `descr` FROM `tbl_srv` WHERE `vkl` = '1' ORDER BY `name`";
        $srv_tmp = mysqli_query($dbcnx,$query1);
          if(!$srv_tmp) {puterror($result2['skin'],$TEXT['error-tbl1']); require_once "../utils/bottom_adm.php"; exit();}
              while($srv = mysqli_fetch_array($srv_tmp,MYSQLI_ASSOC))
                {
                $chk = "<option value=".$srv['srv_id'].">".$srv['name']."(".$srv['descr'].")";
                 echo $chk;
                }
    ?>
    </select></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['tbl-house']; ?></td>
    <td><select name="house_id">
    <?php
        $query2 = "SELECT * FROM `tbl_house` ORDER BY `house`";
        $srv_tmp2 = mysqli_query($dbcnx,$query2);
          if(!$srv_tmp2) {puterror($result2['skin'],$TEXT['error-tbl10']); require_once "../utils/bottom_adm.php"; exit();}
              while($house = mysqli_fetch_array($srv_tmp2,MYSQLI_ASSOC))
                {
                $house = "<option value=".$house['house_id'].">".$house['house'];
                 echo $house;
                }
    ?>
    </select></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['tbl-etazh']; ?></td>
    <td><select name="etazh_id">
    <?php
        $query3 = "SELECT * FROM `tbl_etazh` ORDER BY `etazh`";
        $srv_tmp3 = mysqli_query($dbcnx,$query3);
          if(!$srv_tmp3) {puterror($result2['skin'],$TEXT['error-tbl11']); require_once "../utils/bottom_adm.php"; exit();}
              while($etazh = mysqli_fetch_array($srv_tmp3,MYSQLI_ASSOC))
                {
                $etazh = "<option value=".$etazh['etazh_id'].">".$etazh['etazh'];
                 echo $etazh;
                }
    ?>
    </select></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['tbl-oborud']; ?></td>
    <td><select name="obor_id">
    <?php
        $query4 = "SELECT * FROM `tbl_oborud` ORDER BY `oborud`";
        $srv_tmp4 = mysqli_query($dbcnx,$query4);
          if(!$srv_tmp4) {puterror($result2['skin'],$TEXT['error-tbl12']); require_once "../utils/bottom_adm.php"; exit();}
              while($oborud = mysqli_fetch_array($srv_tmp4,MYSQLI_ASSOC))
                {
                $oborud = "<option value=".$oborud['obor_id'].">".$oborud['oborud'];
                 echo $oborud;
                }
    ?>
    </select></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['srvpar-hostname']; ?></td><td>
 <select name=opthstnm>
   <option value='0' selected ><?php echo $TEXT['srvpar-vikl']; ?>
   <option value='1' ><?php echo $TEXT['srvpar-vkl']; ?>
 </select>
</td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['podset-name']; ?></td><td class="bold_it"><input size=15 maxlength=15 class="input" type=text name=podset /></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['addr-prefix']; ?></td><td class="bold_it"><input size=20 maxlength=255 class="input" type=text name=prefix /></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['podset-begin']; ?></td><td><textarea cols=48 rows=5 name=begin_subn ></textarea></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['podset-end']; ?></td><td><textarea cols=48 rows=5 name=end_subn ></textarea></td></tr>
<tr><td></td><td><input class="button2" type=submit value='<?php echo $button; ?>' /></td></tr>
</table>
</form>
<?php
require_once "../utils/bottom_adm.php";
?>