$sql
Ip | Name | Total | Sent | Received | tcp | udp | icmp | http | smtp | ftp"; if (!isset($subnet)) // Set this now for total graphs $subnet = "0.0.0.0/0"; // Output Total Line echo " |
Total | $subnet"; foreach (array("total", "sent", "received", "tcp", "udp", "icmp", "http", "p2p", "ftp") as $key) { for($Counter=0, $Total = 0; $Counter < $num_rows; $Counter++) { $r = $result[$Counter]; $Total += $r[$key]; } echo fmtb($Total); } echo "\n"; // Output Other Lines for($Counter=0; $Counter < $num_rows && $Counter < $limit; $Counter++) { $r = $result[$Counter]; $r['ip'] = long2ip($r['ip']); echo " | |||||||||
"; echo $r['ip']." | ".gethostbyaddr($r['ip']); echo ""; echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']). fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']). fmtb($r['p2p']).fmtb($r['ftp'])."\n"; } echo " |