summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Campbell-Smith <mcampbellsmith@gmail.com>2014-04-10 12:12:15 +1000
committerMark Campbell-Smith <mcampbellsmith@gmail.com>2014-04-10 12:12:15 +1000
commited979e37c78853d1741e4e9c233531c1d556ea96 (patch)
tree7ff5985335e4be7a6d739fc2947efe1778979f61
parent73fe9afe763e2f73792b15c781b2e948caa8c55f (diff)
downloadRunnerUpLive-ed979e37c78853d1741e4e9c233531c1d556ea96.zip
fix winter/summer timezones
-rwxr-xr-xrequests.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/requests.php b/requests.php
index e4cd35b..b112412 100755
--- a/requests.php
+++ b/requests.php
@@ -166,12 +166,7 @@ switch($action) {
$lat = isset($_REQUEST["lat"]) ? $_REQUEST["lat"] : NULL;
$long = isset($_REQUEST["long"]) ? $_REQUEST["long"] : NULL;
// If the client uses Backitude then convert the date into handled format
- if ($requireddb == 'backitude') {
- $dateoccurred = isset($_REQUEST["do"]) ? date("Y-m-d H:i:s",intval($_REQUEST["do"])) : NULL;
- }
- else {
- $dateoccurred = isset($_REQUEST["do"]) ? $_REQUEST["do"] : NULL;
- }
+ $dateoccurred = isset($_REQUEST["do"]) ? $_REQUEST["do"] : NULL;
$altitude = isset($_REQUEST["alt"]) ? $_REQUEST["alt"] : NULL;
$angle = isset($_REQUEST["ang"]) ? $_REQUEST["ang"] : NULL;
$speed = isset($_REQUEST["sp"]) ? $_REQUEST["sp"] : NULL;
@@ -225,10 +220,18 @@ switch($action) {
}
}
}
- $sql = "INSERT INTO positions "
- ."(FK_Users_ID,FK_Trips_ID,Latitude,Longitude,DateOccurred,FK_Icons_ID,"
- ."Speed,Altitude,Comments,ImageURL,Angle,SignalStrength,SignalStrengthMax,"
- ."SignalStrengthMin,BatteryStatus) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+ if ($requireddb == 'backitude') {
+ $sql = "INSERT INTO positions "
+ ."(FK_Users_ID,FK_Trips_ID,Latitude,Longitude,DateOccurred,FK_Icons_ID,"
+ ."Speed,Altitude,Comments,ImageURL,Angle,SignalStrength,SignalStrengthMax,"
+ ."SignalStrengthMin,BatteryStatus) VALUES (?,?,?,?,FROM_UNIXTIME(?),?,?,?,?,?,?,?,?,?,?)";
+ } else {
+ $sql = "INSERT INTO positions "
+ ."(FK_Users_ID,FK_Trips_ID,Latitude,Longitude,DateOccurred,FK_Icons_ID,"
+ ."Speed,Altitude,Comments,ImageURL,Angle,SignalStrength,SignalStrengthMax,"
+ ."SignalStrengthMin,BatteryStatus) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+ }
+
$query = $mysqli->prepare($sql);
$query->bind_param('iiddsiddssdiiii',
$userid,$tripid,$lat,$long,$dateoccurred,$iconid,