Select Git revision
cif-encoder.ts
table_TopTargetports.php 493 B
<?php
include("db.php");
$q = "select target_port, count(*) as events, sum(attack_scale) as totalScale from events where detected > from_unixtime(unix_timestamp(now())-3600*24*30) group by target_port order by totalScale desc limit 300;";
$res = mysql_query($q, $db);
if (mysql_num_rows($res) == 0) { die("nodata");}
$d = array();
while ($tmp = mysql_fetch_assoc($res)) {
array_push($d, $tmp);
}
mysql_free_result($res);
mysql_close($db);
print json_encode(array("aaData" => $d));
?>