<?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['whitelst-title'];
  $helppage = $TEXT['whitelst-help'];
  require_once "../../config.php";
  require_once "../../util/top_layer2.php";

  if($result2['administrator'] == 0) puterror3($TEXT['error-loginform4']);
?>
<img alt="<?php echo $TEXT['bllst-add']; ?>" src= "../../img/insert.png" height="15" align="top" /><a class="boldit" href="addform.php" title="<?php echo $TEXT['bllst-add-title']; ?>"><?php echo $TEXT['bllst-add']; ?></a>
 <br />
 <br />
 <span class="tabledata"><?php echo $TEXT['bllst-text1']; ?></span>
<table class="table" border="1" cellpadding="3" cellspacing="0" width="50%">
<?php
     $query = "SELECT * FROM `whitelist` ORDER BY `address`";
     $result = mysql_query($query);
     if(!$result) puterror3($TEXT['error-tbl29']);
       if(mysql_num_rows($result)>0);
         {
           echo "<tr class='tableheadercat'>
            <td>".$TEXT['bllst-text2']."</td>
            <td colspan=2>".$TEXT['tbl-action']."</td>
                 </tr>";
             while($result_bllst = mysql_fetch_array($result,MYSQL_ASSOC))
               {
              $edit = "<a href=editform.php?address=".$result_bllst['address']." title='".$TEXT['bllst-text3']."'>".$TEXT['tbl-edit']."</a>";
              $delete = "<a href=delete.php?address=".$result_bllst['address']." 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_bllst['address']; ?></td>
              <td><?php echo $edit; ?></td>
              <td><?php echo $delete; ?></td>
          </tr>
           <?php
               }
         }
?>
</table>
<?php
  require_once "../../util/bottom_exp.php";
?>