Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. var marker =[];
  2. var markerarray =[];
  3. var newcoordinate=[];
  4. var coordinates=[];
  5. var myLatlng = new google.maps.LatLng(3.3950644,-76.525664);
  6. var mapOptions = {
  7. zoom: 13,
  8. center: myLatlng
  9. }
  10. var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  11.  
  12.  
  13.  
  14. setInterval(function(){
  15. $.ajax({
  16. type: "get",
  17. url: "marks.php",
  18. success: function(data){
  19. var split = data.split(',');
  20.  
  21. var parada = split[2];
  22. var busname = split[3];
  23. coordinates = (split[0]+','+split[1]);
  24.  
  25. newcoordinate = new google.maps.LatLng(coordinates.split(",")[0],coordinates.split(",")[1]);
  26.  
  27.  
  28.  
  29. marker = new MarkerWithLabel({
  30. map:map,
  31.  
  32. });
  33.  
  34. marker.setPosition(newcoordinate);
  35.  
  36. }
  37. });
  38. },2000);
  39.  
  40. $query = "
  41. SELECT DISTINCT MAX ( OP.TELEGRAMDATE), B.BUSNUMBER,OP.Stopid, OP.GPSX,OP.GPSY,L.SHORTNAME
  42. FROM Sgco.OPERATIONALINFO OP, sgco.LINES L, sgco.BUSES B
  43. WHERE L.PLANVERSIONID = (select max(p.planversionid) from sgco.planversions p
  44. where PLANVERSIONID NOT IN ('9001', '9000')
  45. and p.activationdate <= to_date('01-06-2015')
  46. and B.PLANVERSIONID = L.PLANVERSIONID )
  47. AND L.LINEID = OP.LINEID
  48. AND OP.LINEID = (SELECT lineid FROM sgco.lines
  49. WHERE SHORTNAME = UPPER ('A77')
  50. AND planversionid = L.PLANVERSIONID)
  51. AND B.BUSID = OP.BUSNUMBER
  52. GROUP BY TELEGRAMDATE, B.BUSNUMBER,Stopid,GPSX,GPSY,SHORTNAME
  53. ";
  54.  
  55. $result = oci_parse($connect, $query);
  56. oci_execute($result);
  57.  
  58.  
  59. $i=0;
  60. while (($row = oci_fetch_array($result, OCI_BOTH)) != false)
  61. {
  62.  
  63.  
  64. $datosq [$i][0]=$row[0].'1<br>';//fecha
  65. $datosq [$i][1]=$row[1].'2<br>';//numbus
  66. $datosq [$i][2]=$row[2].'3<br>';//stopid
  67. $datosq [$i][3]=$row[3].'4<br>';//long
  68. $datosq [$i][4]=$row[4].'5<br>';//lat
  69.  
  70.  
  71. $row[4] = preg_replace('/3/','3.',$row[4],1);
  72. $row[3] = preg_replace('/-76/','-76.',$row[3],1);
  73. /*echo '<script>alert ('.$row[2].')</script>';*/
  74.  
  75. $conImagen=$i+1;
  76.  
  77.  
  78.  
  79.  
  80. echo $row[4].','.$row[3].','.$row[2].','.$row[1].',';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement