From: Neil S. <sir...@us...> - 2003-06-19 07:45:32
|
CVSROOT : /cvsroot/publicdnsadmin Module : publicdnsadmin Commit time: 2003-06-19 07:45:31 UTC Modified files: index.php style.css docs/CHANGELOG Log message: Author: SiRVu|caN Log message: Added a offset system, 10 domains displayed per page. ---------------------- diff included ---------------------- Index: publicdnsadmin/docs/CHANGELOG diff -u publicdnsadmin/docs/CHANGELOG:1.10 publicdnsadmin/docs/CHANGELOG:1.11 --- publicdnsadmin/docs/CHANGELOG:1.10 Wed Jun 18 23:04:38 2003 +++ publicdnsadmin/docs/CHANGELOG Thu Jun 19 00:45:21 2003 @@ -17,3 +17,4 @@ SiRVu|caN <sir...@si...> - 18/6/2003 - Made the Contact email address changable in config.php. SiRVu|caN <sir...@si...> - 19/6/2003 - Added a small image to fill up some of the white space. SiRVu|caN <sir...@si...> - 19/6/2003 - Improved dbbackup.php, now doesnt require seperate conf. +SiRVu|caN <sir...@si...> - 19/6/2003 - Added a offset system, 10 domains displayed per page. Index: publicdnsadmin/index.php diff -u publicdnsadmin/index.php:1.4 publicdnsadmin/index.php:1.5 --- publicdnsadmin/index.php:1.4 Wed Jun 18 03:26:58 2003 +++ publicdnsadmin/index.php Thu Jun 19 00:45:20 2003 @@ -36,11 +36,16 @@ if (count($zones)) { $dbh = db_connect(); - echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background: #000000;\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><th>Domain</th><th>Current serial</th><th>Owner</th><th>Records</th><th> </th></tr>\n"; $row_id = 0; + $row_count = 0; + $offsetmin = $offset; + $offsetmax = $offset + 10; + + echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background: #000000;\"><table border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><th>Domain</th><th>Current serial</th><th>Owner</th><th>Records</th><th> </th></tr>\n"; foreach ($zones as $zone) { $row_id++; + $row_count++; $serial = getZoneSerial($zone["id"]); $records = 0; @@ -57,29 +62,50 @@ $owner = htmlentities($tmprow["username"]); } - echo "<tr>\n"; - echo "<td class=\"row$row_id\"><a href=\"edit_zone.php?id=".$zone["id"]."\">".htmlentities($zone["name"])."</a></td>\n"; - echo "<td class=\"row$row_id\" align=\"right\">$serial</td>\n"; - echo "<td class=\"row$row_id\" align=\"right\">$owner</td>\n"; - echo "<td class=\"row$row_id\" align=\"right\">$records</td>\n"; - echo "<td class=\"row$row_id\" align=\"center\">"; - - if ($zone["delete"]) { - echo " <a href=\"delete_zone.php?id=".$zone["id"]."\"><img src=\"images/trash.png\" alt=\"Delete zone\" border=\"0\"></a> "; - echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; - } else { - echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; -// echo " "; - } - - echo "</td>\n"; - echo "</tr>\n"; + if (($row_count >= $offsetmin) && ($row_count <= $offsetmax)) { + echo "<tr>\n"; + echo "<td class=\"row$row_id\"><a href=\"edit_zone.php?id=".$zone["id"]."\">".htmlentities($zone["name"])."</a></td>\n"; + echo "<td class=\"row$row_id\" align=\"right\">$serial</td>\n"; + echo "<td class=\"row$row_id\" align=\"right\">$owner</td>\n"; + echo "<td class=\"row$row_id\" align=\"right\">$records</td>\n"; + echo "<td class=\"row$row_id\" align=\"center\">"; + + if ($zone["delete"]) { + echo " <a href=\"delete_zone.php?id=".$zone["id"]."\"><img src=\"images/trash.png\" alt=\"Delete zone\" border=\"0\"></a> "; + echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; + } else { + echo " <a href=\"whois.php?id=".$zone["id"]."\"><img src=\"images/whois.gif\" height=20 width=20 alt=\"WHOIS Domain\" border=\"0\"></a> "; + } + echo "</td>\n"; + echo "</tr>\n"; + } if ($row_id == 2) { $row_id = 0; } } + if ($row_count > 10) { + $offsettop = $row_count - 10; + $nums = round($row_count / 10); + $num_count = 0; + echo "<tr><td class=\"rowsearch\" colspan=5><center>"; + echo "<a href=\"index.php?offset=1\"><<</a> | "; + $prev = $offset - 10; + if ($prev < 0) { + echo "< | "; + } else { + echo "<a href=\"index.php?offset=$prev\"><</a> | "; + } + while ($num_count < $nums) { + $num_count++; + $off = $num_count * 10 - 10; + echo "<a href=\"index.php?offset=$off\">$num_count</a> "; + } + $next = $offset + 10; + echo "| <a href=\"index.php?offset=$next\">></a> | "; + echo "<a href=\"index.php?offset=$offsettop\">>></a>"; + echo "</center></th></tr>"; + } echo "</table></td></tr></table>\n"; - $dbh->disconnect(); } else { echo "<p>No zones available</p>\n"; Index: publicdnsadmin/style.css diff -u publicdnsadmin/style.css:1.3 publicdnsadmin/style.css:1.4 --- publicdnsadmin/style.css:1.3 Fri Jun 13 08:57:39 2003 +++ publicdnsadmin/style.css Thu Jun 19 00:45:20 2003 @@ -86,6 +86,13 @@ text-decoration: underline; } +.rowsearch { + background: #C7DDF4; + color: #AEAEAE; + font-family: Tahoma, Arial, sans-serif; + font-size: 11px; +} + .row1 { background: #e6ebef; } ----------------------- End of diff ----------------------- |