Advertisement
sopyanx

mikrotik_genxml.php

Aug 9th, 2019
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2. header('Content-type: text/xml');
  3. header('Pragma: public');
  4. header('Cache-control: private');
  5.  
  6. include("koneksi.php");
  7.  
  8. echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
  9. echo "<markers>";
  10. $sql="SELECT * FROM  `gps` WHERE `datetime` >= NOW() - INTERVAL 1 DAY";
  11. $query=mysql_query($sql) or die(mysql_error());
  12. while ($data=mysql_fetch_array($query)) {
  13.     echo "<marker identity='".$data['identity']."' mac='".$data['mac']."' latitude='".$data['latitude']."' longitude='".$data['longitude']."' lat='".$data['lat']."' lng='".$data['lng']."' date='".$data['date']."' dbm='".$data['dbm']."' technology='".$data['technology']."' speed='".$data['speed']."' altitude='".$data['altitude']."' satellites='".$data['satellites']."'/>";
  14.    
  15. }
  16. echo "</markers>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement