<?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['domain-title'];
  $helppage = $TEXT['domain-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']);
?>
 <img alt="<?php echo $TEXT['domain-add-new']; ?>" src= "../img/insert.png" height="15" align="top" /><a class="boldit" href="addform.php" title="<?php echo $TEXT['domain-add-new-tit']; ?>"><?php echo $TEXT['domain-add-new']; ?></a>
 <br />
 <br />
 <span class="tabledata"><?php echo $TEXT['domain-text1']; ?></span>
<table class="table" border="1" cellpadding="3" cellspacing="0" width="50%">
<?php
     $query = "SELECT * FROM `tbl_domain` ORDER BY `domain`";
     $result = mysql_query($query);
     if (!$result) puterror2($TEXT['error-tbl5']);
       if (mysql_num_rows($result)>0);
         {
           echo "<tr class='tableheadercat'>
            <td>".$TEXT['tbl-domain']."</td>
            <td colspan=2>".$TEXT['tbl-action']."</td>
                 </tr>";
             while($result_domains = mysql_fetch_array($result,MYSQL_ASSOC))
               {
              $edit = "<a href=editform.php?dom_id=".$result_domains['dom_id']." title='".$TEXT['tbl-edit-tit-domain']."'>".$TEXT['tbl-edit']."</a>";
              $delete = "<a href=deleteform.php?dom_id=".$result_domains['dom_id']." title='".$TEXT['tbl-delete-tit-domain']."'>".$TEXT['tbl-delete']."</a>";
           ?>
           <tr class='tabledata' onmouseover="this.style.backgroundColor='#cccccc';" onmouseout="this.style.backgroundColor='#ffffff';">
              <td><?php echo $result_domains['domain']; ?></td>
              <td><?php echo $edit; ?></td>
              <td><?php echo $delete; ?></td>
           </tr>
           <?php
               }
         }
?>
</table>
<?php
  require_once "../util/bottom.php";
?>