Ejemplo n.º 1
0
$html->addHtmlAttribute("title", "List of hosts");
$firstLetter = $html->getHttpGetVar("firstLetter", 'a');
$pageNum = $html->getHttpGetVar("pageNum", 0);
$pageSize = $html->getHttpGetVar("pageSize", HtmlModule::$DEFAULTPAGESIZE);
$sort = $html->getHttpGetVar("sortBy", "hostname");
$hostsCount = $pakiti->getManager("HostsManager")->getHostsCount();
// if displaying all
if ($firstLetter == "all") {
    $hosts = $pakiti->getManager("HostsManager")->getHosts($sort);
} else {
    //$hosts = $pakiti->getManager("HostsManager")->getHosts($sort, $pageSize, $pageNum);
    $hosts = $pakiti->getManager("HostsManager")->getHostsByFirstLetter($firstLetter);
}
$displayAllLink = $html->getQueryString(array("firstLetter" => "all"));
//---- Output HTML
$html->printHeader();
# Print table with hosts
?>
<p>Total hosts: <?php 
print $hostsCount;
?>
 (<a href="<?php 
print $displayAllLink;
?>
">display all</a>)</p>

<div class="paging">
<?php 
print $html->alphabeticPaging();
?>
</div>