userdata["acclevel"] < 80) die ("Access denied!"); ?>      ?mode=admin&task=">title; if (isset($_GET['hostgroup'])) { echo ""; } ?> (Last Days)

         

"; } ?> query(" SELECT COUNT(*), COUNT(DISTINCT ipAddress) FROM hlstats_Events_Connects WHERE hostgroup='".mysql_real_escape_string($hostgroup)."' "); list($totalconnects, $numitems) = $db->fetch_row($result); $result = $db->query(" SELECT IF(hostname='', ipAddress, hostname) AS host, COUNT(hostname) AS freq, (COUNT(hostname) / $totalconnects) * 100 AS percent FROM hlstats_Events_Connects WHERE hostgroup='".mysql_real_escape_String($hostgroup)."' GROUP BY host ORDER BY $table->sort $table->sortorder, $table->sort2 $table->sortorder LIMIT $table->startitem,$table->numperpage "); $table->draw($result, $numitems, 95, "center"); } else { $table = new Table( array( new TableColumn( "hostgroup", "Host", "width=41&icon=server&link=" . urlencode("mode=admin&task=tools_ipstats&hostgroup=%k") ), new TableColumn( "freq", "Connects", "width=12&align=right" ), new TableColumn( "percent", "Percentage of Connects", "width=30&sort=no&type=bargraph" ), new TableColumn( "percent", "%", "width=12&sort=no&align=right&append=" . urlencode("%") ) ), "hostgroup", // keycol "freq", // sort "hostgroup", // sort2 true, // showranking 50 // numperpage ); $result = $db->query(" SELECT COUNT(*), COUNT(DISTINCT hostgroup) FROM hlstats_Events_Connects "); list($totalconnects, $numitems) = $db->fetch_row($result); $result = $db->query(" SELECT IF(hostgroup='', '(Unresolved IP Addresses)', hostgroup) AS hostgroup, COUNT(hostgroup) AS freq, (COUNT(hostgroup) / $totalconnects) * 100 AS percent FROM hlstats_Events_Connects GROUP BY hostgroup ORDER BY $table->sort $table->sortorder, $table->sort2 $table->sortorder LIMIT $table->startitem,$table->numperpage "); $table->draw($result, $numitems, 95, "center"); } ?>