/
full-report.php
42 lines (35 loc) · 977 Bytes
/
full-report.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require 'inc/lib.inc';
require 'header.php';
?>
<TABLE width="99%">
<TR>
<TD align="left"><H1>Annotated list of all known zones</H1>
</TR>
</TABLE>
<HR><P>
<?php
#
# MAIN
#
get_input();
$count = $db->prepare("SELECT COUNT(*) FROM records WHERE zone = ?");
$annotations = $db->prepare("SELECT descr FROM annotations WHERE zone = ?");
$db->query("SELECT domain, id, master FROM zones WHERE domain != 'TEMPLATE'".access()." ORDER BY domain");
while ($db->next_record()) {
extract($db->Record);
if ($master)
$zonedetails = "[Slave zone, master = $master]";
else {
$count->execute(array($id)); # php execute (not phplib), so must be an array.
$rrs = $count->fetchColumn();
$zonedetails = "[Authoritative zone, contains $rrs Resource Records]";
}
$annotations->execute(array($id));
$descr = $annotations->fetchColumn();
$html = join("<BR>\n", explode("\n", $descr));
print "<B>$domain</B> $zonedetails<P>\n<UL>$html</UL>\n<P>\n";
}
?>
</BODY>
</HTML>