query('SELECT COUNT(*) FROM bots'); $totalBots = $query->fetchColumn(); $total = $totalBots; if($total == 0) echo('
Database is empty
'); else { ?>
prepare('SELECT COUNT(*) FROM bots WHERE last_seen > ?'); $query->bindValue(1, time() - $CONF_TIMEOUT_OFFLINE, PDO::PARAM_INT); $query->execute(); $online = (int) $query->fetchColumn(); $offline = $total - $online; $query = $db->prepare('SELECT COUNT(*) FROM bots WHERE last_seen < ?'); $query->bindValue(1, time() - $CONF_TIMEOUT_DEAD, PDO::PARAM_INT); $query->execute(); $dead = $query->fetchColumn(); $query = $db->prepare('SELECT COUNT(*) FROM bots WHERE last_seen > ?'); $query->bindValue(1, time() - 60 * 60 * 24, PDO::PARAM_INT); $query->execute(); $online24h = (int) $query->fetchColumn(); ?>
Amount
Total:
Online:
Offline:
Bots seen since 24h:
Dead:
query('SELECT COUNT(*) FROM bots WHERE arch = 1'); $x64 = $query->fetchColumn(); $os = array(); $query = $db->query('SELECT os FROM bots'); $rows = $query->fetchAll(); foreach($rows as $row) { $osName = get_os($row['os']); if(isset($os[$osName])) ++$os[$osName]; else $os[$osName] = 1; } arsort($os); ?>
Computer Info
$value) echo(''); ?>
'.$key.':'.format_count($value).'
x64:
x86:
Countries
query('SELECT DISTINCT country, COUNT(*) as num FROM bots GROUP BY country ORDER BY num DESC'); $rows = $query->fetchAll(); $geoip = new GeoIP(); foreach($rows as $row) { echo(''); } ?>
'.$row['country'].' ('.$geoip->GEOIP_COUNTRY_NAMES[$geoip->GEOIP_COUNTRY_CODE_TO_NUMBER[$row['country']]].'):'.format_count($row['num']).'