Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. <?php
  2. /**
  3. * These are some options for the ACARS map, you can change here
  4. *
  5. * By default, the zoom level and center are ignored, and the map
  6. * will try to fit the all the flights in. If you want to manually set
  7. * the zoom level and center, set "autozoom" to false.
  8. *
  9. * You can use these MapTypeId's:
  10. * http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId
  11. *
  12. * Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive
  13. *
  14. * Also, how to style the acars pilot list table. You can use these style selectors:
  15. *
  16. * table.acarsmap { }
  17. * table.acarsmap thead { }
  18. * table.acarsmap tbody { }
  19. * table.acarsmap tbody tr.even { }
  20. * table.acarsmap tbody tr.odd { }
  21. */
  22. ?>
  23. <script type="text/javascript">
  24. <?php
  25. /* These are the settings for the Google map. You can see the
  26. Google API reference if you want to add more options.
  27.  
  28. There's two options I've added:
  29.  
  30. autozoom: This will automatically center in on/zoom
  31. so all your current flights are visible. If false,
  32. then the zoom and center you specify will be used instead
  33.  
  34. refreshTime: Time, in seconds * 1000 to refresh the map.
  35. The default is 10000 (10 seconds)
  36. */
  37. ?>
  38. var acars_map_defaults = {
  39. autozoom: true,
  40. zoom: 4,
  41. center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"),
  42. mapTypeId: google.maps.MapTypeId.TERRAIN,
  43. refreshTime: 10000
  44. };
  45. </script>
  46. <div class="mapcenter" align="center">
  47. <div id="acarsmap1" style="width:<?php echo Config::Get('MAP_WIDTH');?>; height: <?php echo Config::Get('MAP_HEIGHT')?>"></div>
  48. </div>
  49. <?php
  50. /* See below for details and columns you can use in this table */
  51. ?>
  52. <table border = "0" width="100%" class="acarsmap">
  53. <thead>
  54. <tr>
  55. <td><b>Pilot</b></td>
  56. <td><b>Flight Number</b></td>
  57. <td><b>Departure</b></td>
  58. <td><b>Arrival</b></td>
  59. <td><b>Status</b></td>
  60. <td><b>Altitude</b></td>
  61. <td><b>Speed</b></td>
  62. <td><b>Distance/Time Remain</b></td>
  63. </tr>
  64. </thead>
  65. <tbody id="pilotlist">
  66. <?php
  67. $flights = DB::get_results("SELECT * FROM `phpvms_acarsdata`");
  68. if($flights != null){foreach($flights as $flights){
  69. ?>
  70. <tr>
  71. <td><?php echo $flights->pilotname; ?></td>
  72. <td><?php echo $flights->flightnum; ?></td>
  73. <td><?php echo $flights->depicao; ?></td>
  74. <td><?php echo $flights->arricao; ?></td>
  75. <td><?php echo $flights->phasedetail; ?></td>
  76. <td><?php echo $flights->altitude; ?></td>
  77. <td><?php echo $flights->gs; ?></td>
  78. <td><?php echo $flights->distremain; ?></td>
  79. </tr>
  80.  
  81. <?php
  82. }
  83. ?>
  84. </tbody>
  85. </table>
  86. <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script>
  87.  
  88.  
  89. <?php
  90. /* This is the template for the little map bubble which pops up when you click on a flight
  91. Same principle as above, keep the <%=...%> tags intact. The same variables are available
  92. to use here as are available above.
  93. */
  94. ?>
  95. <script type="text/html" id="acars_map_bubble">
  96. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  97. <a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a><br />
  98. <strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br />
  99. <strong>Status: </strong><%=flight.phasedetail%><br />
  100. <strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br />
  101. </span>
  102. </script>
  103.  
  104. <?php
  105. /* This is a small template for information about a navpoint popup
  106.  
  107. Variables available:
  108.  
  109. <%=nav.title%>
  110. <%=nav.name%>
  111. <%=nav.freq%>
  112. <%=nav.lat%>
  113. <%=nav.lng%>
  114. <%=nav.type%> 2=NDB 3=VOR 4=DME 5=FIX 6=TRACK
  115. */
  116. ?>
  117. <script type="text/html" id="navpoint_bubble">
  118. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  119. <strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br />
  120. <strong>Type: </strong>
  121. <?php /* Show the type of point */ ?>
  122. <% if(nav.type == 2) { %> NDB <% } %>
  123. <% if(nav.type == 3) { %> VOR <% } %>
  124. <% if(nav.type == 4) { %> DME <% } %>
  125. <% if(nav.type == 5) { %> FIX <% } %>
  126. <% if(nav.type == 6) { %> TRACK <% } %>
  127. <br />
  128. <?php /* Only show frequency if it's not a 0*/ ?>
  129. <% if(nav.freq != 0) { %>
  130. <strong>Frequency: </strong><%=nav.freq%>
  131. <% } %>
  132. </span>
  133. </script>
  134. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement