geReportFLS($aFrom, $aTo,$top);//<== return array("tblReportFLS", $result); //return $result; } function getReportFLSTest($from,$to,$sigid,$top){ $camdpams = new Camdpams(); $result = $camdpams->getReportFlsTest($from,$to,$sigid,$top);//<== // $result = $camdpams->getReportFlsTest($from, $to,'173987589','100'); return array("tblReportTest", $result); //return $result; } function getInfectedWorldView($from,$to,$src){ $camdpams = new Camdpams(); $result = $camdpams->getInfectedWorldView($from,$to,$src);//<== return array("tblPrevalentMalware", $result); } function xml_coordinate($file){ $returns=""; $simple = implode(file($file)); $xml = xml_parser_create(); xml_parser_set_option($xml,XML_OPTION_CASE_FOLDING,0); xml_parser_set_option($xml,XML_OPTION_SKIP_WHITE,1); $indexes = array(); $values = array(); xml_parse_into_struct($xml,$simple, $values, $indexes); xml_parser_free($xml); $tmp = ""; $k = 0; $mn = ""; $j=0; for($i=1;$isetHeader("Test"); $tmp->plotLegend(); $tmp->PIEplot(); print $tmp->get_PIE("$fname"); } function getInfectedWorldViewPIE($from,$to,$src){ $returnts = ""; $camdpams = new Camdpams(); $result = $camdpams->getInfectedWorldView_chart($from,$to,$src); $path = "PIE/data/"; // $fname = $path.preg_replace("/(-)/","",$from)."_".preg_replace("/(-)/","",$to)."_$src".".png"; // $f_coord = $path.preg_replace("/(-)/","",$from)."_".preg_replace("/(-)/","",$to)."_$src".".txt"; $fname = $path.date("Y_m_d", strtotime($from))."__".date("Y_m_d", strtotime($to))."_$src".".png"; $f_coord = $path.date("Y_m_d", strtotime($from))."__".date("Y_m_d", strtotime($to))."_$src".".xml"; if(!file_exists($fname)) get_pie_chart($fname,$result[1],$result[0],$f_coord); // $handle = file($f_coord); $handle = explode(";",xml_coordinate($f_coord)); $returnts .= " "; for($i = 0 ;$i"; $returnts .= $html; } $returnts .=""; return $returnts; } function get_country_pie_chart($fname,$val,$legend,$f_coord){ $tmp = new PieChart(1200,1600,$val,$legend,$f_coord); //$tmp->setHeader("Test"); $tmp->plotLegend(); $tmp->PIEplot(); print $tmp->get_PIE("$fname"); } function getInfectedCountryViewPIE($from,$to,$src){ $returnts = ""; $camdpams = new Camdpams(); $result = $camdpams->getInfectedCountryView_chart($from,$to,$src); $path = "PIE/data/"; $fname = $path."country_pie_".date("Y_m_d", strtotime($from))."__".date("Y_m_d", strtotime($to))."_$src".".png"; $f_coord = $path."country_pie_".date("Y_m_d", strtotime($from))."__".date("Y_m_d", strtotime($to))."_$src".".xml"; if(!file_exists($fname)) get_country_pie_chart($fname,$result[1],$result[0],$f_coord); //$handle = file($f_coord); $handle = explode(";",xml_coordinate($f_coord)); $returnts .= " "; for($i=0;$i"; $returnts .= $html; } $returnts .=""; return $returnts; } function getCityTop25Map($from,$to,$src){ $text=""; $html_map=""; $xml = ""; $percent = 1.12; $cnt_city = 25; $imgname = "PIE/world_map1.png"; $path = "PIE/data/"; $fname = $path."city_map_".date("Y_m_d", strtotime($from))."__".date("Y_m_d", strtotime($to))."_$src".".png"; $fxml = $path."city_map_".date("Y_m_d", strtotime($from))."__".date("Y_m_d", strtotime($to))."_$src".".xml"; $conn_string = "host=10.224.18.10 port=5432 dbname=CAMDPAMS user=".$_SERVER['PHP_AUTH_USER']." password=".$_SERVER['PHP_AUTH_PW']; $db_conn = pg_connect($conn_string); $k = 3;$j=1; $city= array();$countr_legend = array(); $im = @imagecreatefrompng($imgname); $ink = imagecolorallocate($im, 255 , 0, 0); list($W, $H) = getimagesize($imgname); $new_width = $W * $percent; $new_height = $H * $percent; $imd = imagecreatetruecolor($new_width, $new_height); $KW=$W; $KH=$H+55; $sql = "SELECT \"CountryCode\",\"CityName\",sum(\"Total\") as total from mis.report_fls_infection_city where (\"Ts\" between '$from' and '$to') "; if($src != 0) $sql .="and (\"CallerTypeId\" =$src) "; $sql .= "group by \"CountryCode\",\"CityName\" order by total desc limit $cnt_city"; $q_city = "select latitude,longitude from mis.geocity_location where \"City\" = $1 and \"CountryCode\" = $2 order by \"Id\" limit 1"; $city_coord = pg_prepare($db_conn,"city_coord",$q_city); $res = pg_query($db_conn,$sql); while($row=pg_fetch_assoc($res)){ $countr_legend[$row['CityName']]=$row['CountryCode']; $city[$row['CityName']] = $row['total']; $q_city = pg_execute($db_conn,"city_coord",array($row['CityName'],$row['CountryCode'])); $row_city = pg_fetch_assoc($q_city); $lat = -$row_city['latitude']; $lat = $lat+90; $lon = $row_city['longitude']+180; $x = $lon*$KW/360; $y = $lat*$KH/180; $kx = ($x+5) * $percent; $ky = ($y+5) * $percent; imageellipse($im, $x, $y, 5, 5, $ink); $xml .= "\t\n"; $html_map .= ""; } imagecopyresampled($imd, $im, 0, 0, 0, 0, $new_width, $new_height, $W, $H); imagedestroy($im); imagepng($imd,$fname); imagedestroy($imd); $handle=fopen($fxml,'w'); fwrite($handle,"\n"); fwrite($handle,"\n"); fwrite($handle,$xml); fwrite($handle,"\n"); fclose($handle); $text .="
"; $text .= $html_map; $text .= "

"; for($i =0;$i"; next($countr_legend); next($city); $j++; } $text .= ""; } $text .= "
"; // $text .= ""; $text .= ""; $text .= key($city)." ".current($city)."
"; return $text; } /* ==================== Sajax Initialisation ==================== */ $sajax_request_type = "POST"; $sajax_debug_mode = 0; sajax_init(); sajax_export( "getReportFLS", "getReportFLSTest", "getInfectedWorldView", "getInfectedWorldViewPIE", "getInfectedCountryViewPIE", "getCityTop25Map" ); sajax_handle_client_request(); ?> [CAMDPAMS MIS] Reports: Malware Detection MIS out of FLS Stats
CAMDPAMS
SignID & Verdict
Live Infection Details
Most Prevalent Malware