det skulle den få fra index.php
<?php
//**********************************************************************************************
//**********************************************************************************************
//***** GG-Tracker is based on Aspicore GSM Tracker. *****
//***** *****
//***** It's in a development phase and no warranties are given for anything. This program *****
//***** may not function the way you expect it and the author is not responsible for *****
//***** anything. However, I hope you enjoy it and ammend it where possible! *****
//***** *****
//***** An example of GG-Tracker is live at
http://gg-tracker.eppenga.com *****
//**********************************************************************************************
//**********************************************************************************************
//**********************************************************************************************
//***** PROGRAM ******
//**********************************************************************************************
header("Expires: 0");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Pragma: no-cache");
header("Content-Type: text/html; charset=ISO-8859-1");
header('Content-Disposition: inline; filename="response.html"');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<style type="text/css">
<!--
td { font-family: verdana,arial,helvetica,sans-serif; font-size: 7pt;
border: 1px solid black;
vertical-align: baseline }
th { font-family: verdana,arial,helvetica,sans-serif; font-size: 8pt; font-weight: bold;
border: 1px solid black;
border-style: solid; border-width: 1px;
vertical-align: baseline }
td.small { font-family: verdana,arial,helvetica,sans-serif; font-size: 6pt }
body { font-family: verdana,arial,helvetica,sans-serif; font-size: 8pt }
base { font-family: Courier,MONOSPACE; font-size: 10pt }
table { border-collapse: collapse; border: solid thin black }
caption { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold }
-->
</style>
<meta http-equiv="refresh" content="60;URL=." />
<title>GG-Tracker (GSM and GPS location combined)</title>
<?php
/* Include settings */
include ("config.php");
/* Open and check connection */
$link = mysql_connect($dbhost, $dbuser, $dbpass, $dbname);
if (!$link) {
printf("Connect failed: %s\n", mysql_connect_error());
exit();
}
/* Calculate history and produce XML files for Google Earth */
if ($ghistory) include ("calc_gearth.php");
/* Get the last position with full details of the tracked phone */
$query = 'SELECT GPSMSGID, PHONE, STATUS, LATITUDE, LONGITUDE, SPEED_KNOTS, COURSE_DEG, TIME_RECEIVED, EVENT_TYPE, CELL_ID, LAC, MCC, MNC, NWNAME, LABEL, REMOTE_IP '
. 'FROM GPS ORDER BY GPSMSGID DESC LIMIT 1';
$result = mysql_query($link, $query);
if (!$result) {
printf("Query failed: %s\r\n", mysql_error($link));
printf("Tried to execute the following SQL query:\r\n");
printf("%s\r\n", $query );
mysql_close($link);
exit();}
$row_cnt = mysql_num_rows($result);
if ($row_cnt == 0) {
printf("No data, connect Aspicore tracker first.\r\n");
exit();
}
else {
$line = mysql_fetch_array($result, mysql_ASSOC);
$id = $line['GPSMSGID'];
$phone = $line['PHONE'];
$status = $line['STATUS'];
$latitude = $line['LATITUDE'];
$longitude = $line['LONGITUDE'];
$speed = round($line['SPEED_KNOTS']*1.852,2);
$course = $line['COURSE_DEG'];
$time = $line['TIME_RECEIVED'];
$nwname = $line['NWNAME'];
$cell = $line['CELL_ID'];
$lac = $line['LAC'];
$mcc = $line['MCC'];
$mnc = $line['MNC'];
$mode = $line['EVENT_TYPE'];
$label = $line['LABEL'];
$ipaddress = $line['REMOTE_IP'];
}
/* Get the last two good positions for a tail */
$query = 'SELECT LATITUDE, LONGITUDE '
. 'FROM GPS WHERE (STATUS = \'A\' OR STATUS = \'X\' OR STATUS = \'C\') '
. 'ORDER BY GPSMSGID DESC LIMIT 1,3';
$result = mysql_query($link, $query);
$row_cnt = mysql_num_rows($result);
if ($row_cnt == 3) {
$line = mysql_fetch_array($result, mysql_ASSOC);
$lat_1 = $line['LATITUDE'];
$lon_1 = $line['LONGITUDE'];
$line = mysql_fetch_array($result, mysql_ASSOC);
$lat_2 = $line['LATITUDE'];
$lon_2 = $line['LONGITUDE'];
$line = mysql_fetch_array($result, mysql_ASSOC);
$lat_3 = $line['LATITUDE'];
$lon_3 = $line['LONGITUDE'];
}
else
{
$lat_1 = $latitude;
$lat_2 = $latitude;
$lat_3 = $latitude;
$lon_1 = $longitude;
$lon_2 = $longitude;
$lon_3 = $longitude;
}
//Google maps script, only execute if there are positions found
if ($status <> "Z") {
echo "
<script src=\"
http://maps.google.com/maps?file=api&v=2&key=$gmaps\" type=\"text/javascript\"></script>
<script type=\"text/javascript\">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById(\"map\"));
map.setCenter(new GLatLng($latitude, $longitude), 14);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
var marker = new GMarker(new GLatLng($latitude, $longitude));
map.addOverlay(marker);
GEvent.addListener(marker, \"click\", function() {
var html = '<div style=\"width: 250px; height: 50; padding-right: 10px\"><font size=2><b>Hello World!</b><br>This is my my current position. If you enjoy this application, please <br><a href=\"
http://blog.eppenga.com/2008/01/23/gsm-tracking-and-navigation/\">read my webblog.<\/a><\/font><\/div>';
marker.openInfoWindowHtml(html);
});
var polyline = new GPolyline([
new GLatLng($lat_3, $lon_3),
new GLatLng($lat_2, $lon_2),
new GLatLng($lat_1, $lon_1),
new GLatLng($latitude, $longitude)
], \"#ff0000\", 7);
map.addOverlay(polyline);
}
}
//]]>
</script>
";
}
//Get some statistical data
include ("calc_stats.php");
//The rest of the internet page
echo "
</head>
<body onload=\"load()\" onunload=\"GUnload()\">
<center>
<table width=600 cellspacing=2 cellpadding=2>
<tr align=center>
<td colspan=3>
<font size=2 color=red><b>Welcome to GG-Tracker (GPS and GSM Tracking)</b></font>
</td>
</tr>
<tr>
<td><b>Current location: $label</b></td>
<td><b>Last report: $time</b></td>
<td><b>Connection from IP: $ipaddress</b></td>
</tr>
<tr>
<td><b>Topspeed today/ever: $maxspeed[1]/$maxspeed[0] km/h</b></td>
<td><b>Distance home: $disthome km</b></td>
<td><b>GSM antenna (useful/total): $gsm_antenna[0]/$gsm_antenna[1]</b></td>
</tr>
</table>";
echo "
<table width=600 cellspacing=0 cellpadding=0)>
<tr><td valign=middle width=600 height=400>";
if ($status == "Z")
{
echo "
<br><br><br><br><br><br><br><br><br><br><br><br>
<b>There is no image to display.</b><p>
The GPS is not connected and the GSM location can not be found in the database.<p>
Please check back later.";}
else
{echo "<div id=\"map\" style=\"width: 596px; height: 400px\"></div>";}
echo "
</td></tr>
</table>";
echo "
<table width=600 cellspacing=2 cellpadding=2>
<tr align=center>
<td colspan=2><b>GSM Information</b></td>
<td colspan=2><b>GPS Information</b></td>
</tr><tr align=left>
<td>Network</td><td>$nwname</td>
<td width=150>Status</td><td width=150>$status</td>
</tr><tr align=left>
<td width=150>Cell ID</td><td width=150>$cell</td>
<td>Latitude</td><td>$latitude deg</td>
</tr><tr align=left>
<td>LAC</td><td>$lac</td>
<td>Longitude</td><td>$longitude deg</td>
</tr><tr align=left>
<td>MCC</td><td>$mcc</td>
<td>Speed</td><td>$speed km/h</td>
</tr><tr align=left>
<td>MNC</td><td>$mnc</td>
<td>Course</td><td>$course deg</td>
</tr>";
//Display history line if set in config.php
if ($ghistory) {
echo "<tr align=center>
<td colspan=4><a href=\"google_earth.kml\"><font color=black><b>Show a history of positions in Google Earth (you need Google Earth installed)</b></font></a></td>
</tr>";}
echo "
</table>
<br>
<a href=\"
http://www.eppenga.com/gg-tracker\" target=_top>
<font size=2 color=red><b>More information, setup and download GG-Tracker application</b></font>
</a>
<br>
<a href=\"
http://www.eppenga.com\"> <font size=1 color=black><i>GG-Tracker is an open-source development project by Ebo Eppenga</i></font>
</a>
</center>\r\n\r\n";
/* Include footer */
include ("footer.php");
echo " </body>\r\n";
echo "</html>";
/* Close and free everything */
// Free resultset
mysql_free_result($result);
/* Close connection */
mysql_close($link);
?>