<?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['hostlst-title'];
  $helppage = $TEXT['hostlst-help'];
  require_once "../../config.php";
  require_once "../../util/top_layer2.php";
  if($result2['administrator'] == 0) puterror3($TEXT['error-loginform4']);
?>
<img alt="<?php echo $TEXT['hostlst-add-tit']; ?>" src= "../../img/insert.png" height="15" align="top" /><a class="boldit" href="addform.php" title="<?php echo $TEXT['hostlst-add-tit']; ?>"><?php echo $TEXT['hostlst-add-tit']; ?></a>
 <br />
 <br />
 <span class="tabledata"><?php echo $TEXT['hostlst-text1']; ?></span>
<table class="table" border="1" cellpadding="3" cellspacing="0" width="50%">
<?php
     $query = "SELECT * FROM `hostlists` ORDER BY `hostname`";
     $result = mysql_query($query);
     if(!$result) puterror3($TEXT['error-tbl30']);
       if(mysql_num_rows($result)>0);
         {
           echo "<tr class='tableheadercat'>
            <td>".$TEXT['hostlst-text2']."</td>
            <td>".$TEXT['analiz-msg-type']."</td>
            <td colspan=2>".$TEXT['tbl-action']."</td>
                 </tr>";
             while($result_hosts = mysql_fetch_array($result,MYSQL_ASSOC))
               {
              $edit = "<a href=editform.php?hostname=".$result_hosts['hostname']." title='".$TEXT['bllst-text3']."'>".$TEXT['tbl-edit']."</a>";
              $delete = "<a href=delete.php?hostname=".$result_hosts['hostname']." title='".$TEXT['bllst-text4']."'>".$TEXT['tbl-delete']."</a>";
           ?>
           <tr class='tabledata' onmouseover="this.style.backgroundColor='#cccccc';" onmouseout="this.style.backgroundColor='#ffffff';">
              <td><?php echo $result_hosts['hostname']; ?></td>
              <td><?php echo $result_hosts['type']; ?></td>
              <td><?php echo $edit; ?></td>
              <td><?php echo $delete; ?></td>
           </tr>
           <?php
               }
         }
?>
</table>
<?php
  require_once "../../util/bottom_exp.php";
?>