echo NagiosHostTemplatePeer::doCount(new Criteria()); ?> </td> </tr> <tr class="odd"> <td><strong>Total Nagios Service Templates:</strong></td> <td><?php echo NagiosServiceTemplatePeer::doCount(new Criteria()); ?> </td> </tr> <tr> <td><strong>Total Nagios Hosts:</strong></td> <td><?php echo NagiosHostPeer::doCount(new Criteria()); ?> </td> </tr> <tr class="odd"> <td><strong>Total Nagios Services:</strong></td> <td><?php echo NagiosServicePeer::doCountAll(); ?> </td> </tr> </table> <?php print_window_footer(); print_footer();
public function renderResults() { global $error; if (count($this->searchResults)) { foreach ($this->searchResults as $group => $results) { print_window_header("Results in " . $this->searchTemplate[$group]['type'] . ": " . count($results), "100%", "center"); ?> <table width="95%" border="0" align="center" cellspacing="0" cellpadding="0"> <tr> <?php if (count($this->searchTemplate[$group])) { foreach ($this->searchTemplate[$group] as $key => $value) { if ($key != "type" && $key != "url") { print "\t<td style=\"padding: 2px; border-bottom: 1px solid #aaaaaa;\"><b>{$value}</b></td>\n"; } } } ?> </tr> <?php $count = 0; $span = count($this->searchTemplate[$group]) - 3; $url = $this->searchTemplate[$group]['url']; if (count($results)) { foreach ($results as $id => $result) { $bgcolor = "#f0f0f0"; if ($count % 2) { $bgcolor = "#cccccc"; } print "<tr style=\"background-color: {$bgcolor}\">\n"; $n = 0; if (count($this->searchTemplate[$group])) { foreach ($this->searchTemplate[$group] as $key => $value) { if ($key != "type" && $key != "url") { if ($n == 0) { print "\t<td style=\"padding: 2px; border-left: 1px solid #aaaaaa; border-bottom: 1px solid #aaaaaa;\" valign=\"top\">"; } elseif ($n == $span) { print "\t<td style=\"padding: 2px; border-right: 1px solid #aaaaaa; border-bottom: 1px solid #aaaaaa;\" valign=\"top\">"; } else { print "\t<td style=\"padding: 2px; border-bottom: 1px solid #aaaaaa;\" valign=\"top\">"; } if (strlen($result->{$key}()) == 0) { $temp = " "; } else { $temp = "<a href=\"" . str_replace("@1@", $id, $url) . "\">" . $result->{$key}() . "</a>"; } print $temp . "</td>\n"; $n++; } } } $count++; print "</tr>\n"; } } ?> </table> <br /> <?php print_window_footer(); } } }