Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'includes.php';
- $gpsdata = array();
- $gpsActualizationDate = 0;
- function LoadGps()
- {
- global $gpsActualizationDate, $gpsdata, $db;
- $gpsdata = $db->query("select * from tracking order by Id DESC limit 1000");
- $gpsActualizationDate = time();
- return $gpsdata;
- }
- function GetGps()
- {
- global $gpsActualizationDate, $gpsdata;
- if (time() - $gpsActualizationDate > 1 )
- {
- return LoadGps();
- }
- return $gpsdata;
- }
- function GetTrack($track)
- {
- global $db;
- return $db->query("select * from tracking where TrackId = $track");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement