Beispiel #1
0
$colHeaders = array("License Server", "Description", "Status", "Current Usage", "Available features/license", "Master", "Version");
$table->addRow($colHeaders, $headerStyle, "TH");
# set width on description col
$table->setColAttributes(1, "width=\"180\"");
# grab all the different server types
foreach ($server as $host) {
    $type[] = $host['type'];
}
# return only unique types
$types = array_unique($type);
# loop thru each unique type and make up status table
foreach ($types as $type) {
    $servers = findServers($type, "type");
    if (sizeof($servers) > 0) {
        $table->addRow(array(strtoupper($type) . " Servers"), $headerStyle, "TH");
        $table->setCellAttributes($table->getRowCount() - 1, 0, "colspan='" . $table->getColCount() . "'");
        for ($i = 0; $i < sizeof($servers); $i++) {
            $cur = current($servers);
            $status_array = getDetails($cur);
            # does this host contain a webui?
            # currently only RLM offers webui
            if (isset($cur["webui"])) {
                $host = "<a href=\"" . $cur["webui"] . "\">" . $cur["hostname"] . "</a>";
            } else {
                $host = $cur["hostname"];
            }
            $table->AddRow(array($host, $cur["desc"], strtoupper($status_array["status"]["service"]), $status_array["status"]["clients"], $status_array["status"]["listing"], $status_array["status"]["master"], $status_array["status"]["version"]));
            # Set the background color of status cell
            $table->updateCellAttributes($table->getRowCount() - 1, 2, "class='" . $status_array["status"]["service"] . "'");
            $table->updateCellAttributes(1, 0, "");
            # fetch status