Please take note of the changes I've made on the remotes.inc.php
(you can either comment it out or delete it)
1.
removed the error display for devices that has not posted locations
yet. the device number will not have any entry in the REST API results
and the Lat / Lng is still blank.
2. I missed commenting out the echo line on the previous file.
Regards,
Robert
// if ( sane ( floatval ($lat), floatval ($lng), intval ($updated) ) ) {
$where_clause = "WHERE `traccar` = 1 AND `callsign` = '{$callsign_in}'";
$integerval = 0 *60; // Set with intval(get_variable('delta_mins'))*60) if you have problems with time sync.
$now = date("Y-m-d H:i:s", time() - $integerval);
$query = "UPDATE `$GLOBALS[mysql_prefix]responder` SET `lat` = " . $lat . ", `lng` = " . $lng . " " . $where_clause;
$result = mysqli_query($tickets_connect, $query);
// removed error message or do_error($query, 'mysql query failed', mysqli_error(), basename( __FILE__), __LINE__);
// any movement?
if ($result) {
// echo "The result status = " . $result . "\n";
$query = "UPDATE `$GLOBALS[mysql_prefix]responder` SET `updated` = '" . date("Y-m-d H:i:s", time()) . "' " . $where_clause;
$result_temp = mysqli_query($tickets_connect, $query) or
do_error($query, 'mysql query failed', mysqli_error(), basename(
__FILE__), __LINE__);
$our_hash = $callsign_in . (string) (abs($lat) + abs($lng)) ; // a hash - for dupe prevention
$query = "INSERT INTO `$GLOBALS[mysql_prefix]tracks` (
packet_id, source, latitude, longitude, speed, course, altitude, packet_date, updated) VALUES (
'{$our_hash}', '{$callsign_in}', '{$lat}', '{$lng}', '{$speed}',
'{$course}', '{$altitude}', '{$p_d_timestamp}', '{$now}')";
$result = mysqli_query($tickets_connect, $query);
} // end if ($results is true)
// } // end if sane
} // end while $row1
mysqli_close($tickets_connect);
} // end function do_traccar()
Regards,