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