summaryrefslogtreecommitdiff
path: root/getpositions.php
diff options
context:
space:
mode:
Diffstat (limited to 'getpositions.php')
-rwxr-xr-xgetpositions.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/getpositions.php b/getpositions.php
index 2f22aa0..9a3acc1 100755
--- a/getpositions.php
+++ b/getpositions.php
@@ -36,16 +36,16 @@ function haversine_distance($lat1, $lon1, $lat2, $lon2) {
if ($userid) {
if ($trackid) {
// get all track data
- $query = $mysqli->prepare("SELECT positions.ID,Latitude,Longitude,Altitude,Speed,Angle,DateOccurred,username,trips.Name,trips.ID FROM positions LEFT JOIN users ON (positions.FK_Users_ID=users.ID) LEFT JOIN trips ON (positions.FK_Trips_ID=trips.ID) WHERE positions.FK_Users_ID=? AND positions.FK_Trips_ID=? ORDER BY positions.DateOccurred");
+ $query = $mysqli->prepare("SELECT positions.ID,positions.Latitude,positions.Longitude,positions.Altitude,positions.Speed,positions.Angle,positions.DateOccurred,positions.Comments,users.username,trips.Name,trips.ID FROM positions LEFT JOIN users ON (positions.FK_Users_ID=users.ID) LEFT JOIN trips ON (positions.FK_Trips_ID=trips.ID) WHERE positions.FK_Users_ID=? AND positions.FK_Trips_ID=? ORDER BY positions.DateOccurred");
$query->bind_param('ii', $userid, $trackid);
}
else {
// get data only for latest point
- $query = $mysqli->prepare("SELECT positions.ID,Latitude,Longitude,Altitude,Speed,Angle,DateOccurred,username,trips.Name,trips.ID FROM positions LEFT JOIN users ON (positions.FK_Users_ID=users.ID) LEFT JOIN trips ON (positions.FK_Trips_ID=trips.ID) WHERE positions.FK_Users_ID=? ORDER BY positions.DateOccurred DESC LIMIT 1");
+ $query = $mysqli->prepare("SELECT positions.ID,positions.Latitude,positions.Longitude,positions.Altitude,positions.Speed,positions.Angle,positions.DateOccurred,positions.Comments,users.username,trips.Name,trips.ID FROM positions LEFT JOIN users ON (positions.FK_Users_ID=users.ID) LEFT JOIN trips ON (positions.FK_Trips_ID=trips.ID) WHERE positions.FK_Users_ID=? ORDER BY positions.DateOccurred DESC LIMIT 1");
$query->bind_param('i', $userid);
}
$query->execute();
- $query->bind_result($positionid,$latitude,$longitude,$altitude,$speed,$angle,$dateoccured,$username,$trackname,$trackid);
+ $query->bind_result($positionid,$latitude,$longitude,$altitude,$speed,$angle,$dateoccured,$comments,$username,$trackname,$trackid);
header("Content-type: text/xml");
$xml = new XMLWriter();
@@ -63,6 +63,7 @@ if ($userid) {
$xml->writeElement("speed", $speed);
$xml->writeElement("angle", $angle);
$xml->writeElement("dateoccured", $dateoccured);
+ $xml->writeElement("comments", $comments);
$xml->writeElement("username", $username);
$xml->writeElement("trackid", $trackid);
$xml->writeElement("trackname", $trackname);