示例#1
0
    settype($gps_max_lat, "float");
    settype($gps_min_lat, "float");
    settype($gps_max_lon, "float");
    settype($gps_min_lon, "float");
    $gps_avg_lat = ($gps_max_lat + $gps_min_lat) / 2;
    $gps_avg_lon = ($gps_max_lon + $gps_min_lon) / 2;
    $wn_encryption = "";
    if ($wn->SSID->encryption) {
        foreach ($wn->SSID->encryption as $enc) {
            $wn_encryption .= $enc . ",";
        }
    }
    $wc_ssid = $wn->{'wireless-client'}->SSID->ssid;
    if ($wn_type == "probe" && $wc_ssid != "") {
        $probe_total++;
        $manufCOLOR = writePoint($fh, $wn_type, $wc_ssid, $wn_manuf, $wc_client_total, $wn_pk_total, $wn_bssid, $wn_channel, $wn_maxrate, $wn_cloaked, $gps_avg_lon, $gps_avg_lat, $wn_encryption, $wn_info, $wc_clients, "BLUE", 0);
        $styleArray[] = $manufCOLOR;
    }
    //end if
}
//end foreach
fwrite($fh, "\n     <description>Total Probe Clients Identified:  {$probe_total}</description>\n   </Folder>\n");
//###########################################
//  WRITE STYLES                            #
//###########################################
$uniqueStyleArray = array_unique($styleArray);
writeStyle($fh, $uniqueStyleArray);
//###########################################
fwrite($fh, "\n </Document>\n</kml>\n");
//end fwrite
?>
示例#2
0
fwrite($fh, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
fwrite($fh, "<kml xmlns=\"http://www.opengis.net/kml/2.2\">\n");
//fwrite($fh, "<kml xmlns=\"http://earth.google.com/kml/0.5\">\n");
fwrite($fh, "<Document>\n");
fwrite($fh, "   <name>IP Address Location</name>\n");
fwrite($fh, "   <description><![CDATA[\n\t\t\t\t\t<p><font face=\"Courier\" size=\"-2\"Results<br>\n\t\t\t\t\t</font></p>\n\t\t\t\t]]></description>\n");
fwrite($fh, "\n  <Style id=\"pushpin\">\n    <IconStyle id=\"mystyle\">\n      <Icon>\n        <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>\n        <scale>1.0</scale>\n      </Icon>\n    </IconStyle>\n  </Style>\n ");
fwrite($fh, "\n   <Folder>\n     <name>IP Addresses</name>\n");
foreach ($lines as $l) {
    $items = explode(",", $l);
    $ip_address = $items[0];
    $country = $items[1];
    $state = $item[2];
    $city = $items[3];
    $gps = explode(" ", $items[4]);
    writePoint($fh, $ip_address, $country, $state, $city, $gps[0], $gps[1]);
}
//end foreach
fwrite($fh, "\n     <description>SOME DESCRIPTION</description>\n   </Folder>\n");
fwrite($fh, "\n </Document>\n</kml>\n");
//end fwrite
?>
<html>
<head>
<title>Ed File Parse</title>
</head>
<body>
<table width="100%"><tr>
    <td valign="top">

</td></tr></table>