";
}
imagecopyresampled($imd, $im, 0, 0, 0, 0, $new_width, $new_height, $W, $H);
imagedestroy($im);
imagepng($imd,"test.png");
imagedestroy($imd);
print "
Infection world map
";
$k = 3;
$j=1;
//for($i =0;$i";
for($ii =0;$ii<=$k;$ii++){
if(current($countr_legend)==NULL){$flag = '-';$n= NULL;}
else{$flag = strtolower(current($countr_legend));$n = $j;}
print "$n |  | ";
// print "".key($countr_legend)." | ".current($countr_legend)." | ";
print "".key($city)." ".current($city)."";
next($countr_legend);
next($city);
$j++;
}
print "";
}
print "
";
}
function city_detail($c_code,$city,$from,$to,$src){
global $db_conn;
$sql = "SELECT \"MalwareName\",sum(\"Total\") as total from mis.report_fls_infection_city
where (\"Ts\" between '$from' and '$to') and \"CountryCode\" = '$c_code' and \"CityName\" = '$city'";
if($src != 'all') $sql .="and \"CallerTypeId\" =$src";
$sql .= "group by \"MalwareName\" order by total desc";
$res = pg_query($db_conn,$sql);
flush();
print "
Infection detail for $city
return to map
Infection detail for $city
# |
Malware Name |
Count |
";
$i =1;
while($row=pg_fetch_assoc($res)){
print "$i | ".$row['MalwareName']." | ".$row['total']." |
";
$i++;
}
print "
";
}
if (!isset($_GET['location'])){start_map($from,$to,$src,$cnt_city);}
else{
city_detail($_GET['location'],$_GET['city'],$from,$to,$src);
}
?>