list_zones.php
changeset 13 2ff220cfde13
child 15 305cee3b388d
equal deleted inserted replaced
12:7be4525290cc 13:2ff220cfde13
       
     1 <?php
       
     2 require_once("inc/i18n.inc.php");
       
     3 require_once("inc/toolkit.inc.php");
       
     4 include_once("inc/header.inc.php");
       
     5 
       
     6 $all_doms = get_domains(0);
       
     7 $num_all_domains = count($all_doms);
       
     8 $doms = get_domains(0,LETTERSTART);
       
     9 show_pages(count($doms),ROWAMOUNT);
       
    10 ?>
       
    11    <h2><? echo _('List zones'); ?></h2>
       
    12 <?
       
    13 if ($num_all_domains > ROWAMOUNT) 
       
    14 {
       
    15 	echo "<div class=\"showmax\">";
       
    16 	show_letters(LETTERSTART,$all_doms);
       
    17 	echo "</div>";
       
    18 }
       
    19 ?>
       
    20    <table>
       
    21     <tr>
       
    22      <th>&nbsp;</th>
       
    23      <th><? echo _('Name'); ?></th>
       
    24      <th><? echo _('Type'); ?></th>
       
    25      <th><? echo _('Records'); ?></th>
       
    26      <th><? echo _('Owner'); ?></th>
       
    27     </tr>
       
    28     <tr>
       
    29 
       
    30 <?
       
    31 if ($num_all_domains < ROWAMOUNT) {
       
    32    $doms = get_domains(0,"all",ROWSTART,ROWAMOUNT);
       
    33 } else {
       
    34    $doms = get_domains(0,LETTERSTART,ROWSTART,ROWAMOUNT);
       
    35    $num_show_domains = count($doms);
       
    36 }
       
    37 
       
    38 // If the user doesnt have any domains print a message saying so
       
    39 if ($doms < 0)
       
    40 {
       
    41 	?>
       
    42     <tr>
       
    43      <td>&nbsp;</td>
       
    44      <td colspan="4"><? echo _('There are no zones.'); ?></td>
       
    45     </tr>
       
    46 <?
       
    47 }
       
    48 
       
    49 // If he has domains, dump them (duh)
       
    50 else
       
    51 {
       
    52 	foreach ($doms as $c)
       
    53 	{
       
    54 		?>
       
    55 		
       
    56     <tr>
       
    57 <?
       
    58 if (level(5))
       
    59 {
       
    60 ?>
       
    61      <td>
       
    62       <a href="edit.php?id=<? echo $c["id"] ?>"><img src="images/edit.gif" title="<? echo _('Edit zone') . " " . $c['name']; ?>" alt="[ <? echo _('Edit zone') . " " . $c['name']; ?> ]"></a>
       
    63       <a href="delete_domain.php?id=<? echo $c["id"] ?>"><img src="images/delete.gif" title="<? print _('Delete zone') . " " . $c['name']; ?>" alt="[<? echo _('Delete zone') . " " . $c['name']; ?>]"></a>
       
    64      </td>
       
    65 <?
       
    66 }
       
    67 else
       
    68 {
       
    69 ?>
       
    70      <td class="n">
       
    71       &nbsp;
       
    72      </td>
       
    73 <?
       
    74 }
       
    75 ?>
       
    76      <td class="y"><? echo $c["name"] ?></td>
       
    77      <td class="y"><? echo strtolower(get_domain_type( $c["id"])) ?></td>
       
    78      <td class="y"><? echo $c["numrec"] ?></td>
       
    79      <td class="y"><? echo get_owner_from_id($c["owner"]) ?></td>
       
    80     </tr><?
       
    81 		print "\n";
       
    82 	}
       
    83 }
       
    84 
       
    85 ?>
       
    86    </table>
       
    87 
       
    88 <?
       
    89 if ($num_all_domains < ROWAMOUNT) {
       
    90 ?>
       
    91    <p><? printf(_('This lists shows all %s zones(s) you have access to.'), $num_all_domains); ?></p>
       
    92 <?
       
    93 }
       
    94 else
       
    95 {
       
    96 ?>
       
    97    <p><? printf(_('This lists shows %s out of %s zones you have access to.'), $num_show_domains, $num_all_domains); ?></p>
       
    98 <?
       
    99 }
       
   100 ?>
       
   101 
       
   102 
       
   103 <? // RZ TODO Check next, does it work? 
       
   104 //  <small> echo _('You only administer some records of domains marked with an (*).'); </small>
       
   105 ?>
       
   106 
       
   107 <?
       
   108 include_once("inc/footer.inc.php");
       
   109 ?>