Advertisement
Guest User

acarsmap.tpl

a guest
May 12th, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. <style>
  2. #innerwrapper{
  3. background:none;
  4. border:none;
  5. padding:0px;
  6. }
  7. </style>
  8. <h3>Live Flight Information</h3>
  9. <div class="box" style="padding:0px;width:100%;">
  10. <?php
  11. /**
  12. * These are some options for the ACARS map, you can change here
  13. *
  14. * By default, the zoom level and center are ignored, and the map
  15. * will try to fit the all the flights in. If you want to manually set
  16. * the zoom level and center, set "autozoom" to false.
  17. *
  18. * You can use these MapTypeId's:
  19. * http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId
  20. *
  21. * Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive
  22. *
  23. * Also, how to style the acars pilot list table. You can use these style selectors:
  24. *
  25. * table.acarsmap { }
  26. * table.acarsmap thead { }
  27. * table.acarsmap tbody { }
  28. * table.acarsmap tbody tr.even { }
  29. * table.acarsmap tbody tr.odd { }
  30. */
  31. ?>
  32. <script type="text/javascript">
  33. <?php
  34. /* These are the settings for the Google map. You can see the
  35. Google API reference if you want to add more options.
  36.  
  37. There's two options I've added:
  38.  
  39. autozoom: This will automatically center in on/zoom
  40. so all your current flights are visible. If false,
  41. then the zoom and center you specify will be used instead
  42.  
  43. refreshTime: Time, in seconds * 1000 to refresh the map.
  44. The default is 10000 (10 seconds)
  45. */
  46. ?>
  47. var acars_map_defaults = {
  48. autozoom: true,
  49. zoom: 4,
  50. center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"),
  51. mapTypeId: google.maps.MapTypeId.TERRAIN,
  52. refreshTime: 10000
  53. };
  54. </script>
  55. <div class="mapcenter" align="center">
  56. <div id="acarsmap" style="width:970px; height: 500px"></div>
  57. </div>
  58. <?php
  59. /* See below for details and columns you can use in this table */
  60. ?>
  61. </div>
  62. <div class="box">
  63. <table border = "1" class="table table-striped" width="100%" class="acarsmap">
  64. <thead>
  65. <tr>
  66. <td width="25%"><center><b>Pilot</b></center></td>
  67. <td width="9%"><center><b>Flight #</b></center></td>
  68. <td width="8%"><center><b>Dep</b></center></td>
  69. <td width="8%"><center><b>Arr</b></center></td>
  70. <td width="9%"><center><b>Status</b></center></td>
  71. <td width="8%"><center><b>Altitude</b></center></td>
  72. <td width="11%"><center><b>Ground Speed</b></center></td>
  73. <td width="12%"><center><b>Dist/Time</b></center></td>
  74. <td width="10%"><center><b>% Complete</b></center></td>
  75. </tr>
  76. </thead>
  77. <tbody id="pilotlist"></tbody>
  78. </table>
  79. <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script>
  80. <?php
  81. /* This is the template which is used in the table above, for each row.
  82. Be careful modifying it. You can simply add/remove columns, combine
  83. columns too. Keep each "section" (<%=...%>) intact
  84.  
  85. Variables you can use (what they are is pretty obvious)
  86.  
  87. Variable: Notes:
  88. <%=flight.pilotid%>
  89. <%=flight.firstname%>
  90. <%=flight.lastname%>
  91. <%=flight.pilotname%> First and last combined
  92. <%=flight.flightnum%>
  93. <%=flight.depapt%> Gives the airport name
  94. <%=flight.depicao%>
  95. <%=flight.arrapt%> Gives the airport name
  96. <%=flight.arricao%>
  97. <%=flight.phasedetail%>
  98. <%=flight.heading%>
  99. <%=flight.alt%>
  100. <%=flight.gs%>
  101. <%=flight.disremaining%>
  102. <%=flight.timeremaning%>
  103. <%=flight.aircraft%> Gives the registration
  104. <%=flight.aircraftname%> Gives the full name
  105. <%=flight.client%> FSACARS/Xacars/FSFK, etc
  106. <%=flight.trclass%> "even" or "odd"
  107.  
  108. You can also use logic in the templating, if you so choose:
  109. http://ejohn.org/blog/javascript-micro-templating/
  110. */
  111. ?>
  112. <script type="text/html" id="acars_map_row">
  113. <tr class="<%=flight.trclass%>">
  114. <td><center><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotname%> - <%=flight.pilotid%></a></center></td>
  115. <td><center><%=flight.flightnum%></center></td>
  116. <td><center><%=flight.depicao%></center></td>
  117. <td><center><%=flight.arricao%></center></td>
  118. <td><center><%=flight.phasedetail%></center></td>
  119. <td><center><%=flight.alt% Feet></center></td>
  120. <td><center><%=flight.gs% Knots></center></td>
  121. <td><center><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%></center></td>
  122. <td><center>><$otaldistance = round(SchedulesData::distanceBetweenPoints($flight->deplat, $flight->deplng, $flight->arrlat, $flight->arrlng));
  123. $percomplete = ABS(number_format(((($totaldistance - $flight->distremain) / $totaldistance) * 100), 2));
  124. $c['percomplete'] = $percomplete;></center></td>
  125. </tr>
  126. </script>
  127. </script>
  128.  
  129. <?php
  130. /* This is the template for the little map bubble which pops up when you click on a flight
  131. Same principle as above, keep the <%=...%> tags intact. The same variables are available
  132. to use here as are available above.
  133. */
  134. ?>
  135. <script type="text/html" id="acars_map_bubble">
  136. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  137. <a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a><br />
  138. <strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br />
  139. <strong>Status: </strong><%=flight.phasedetail%><br />
  140. <strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br />
  141. </span>
  142. </script>
  143.  
  144. <?php
  145. /* This is a small template for information about a navpoint popup
  146.  
  147. Variables available:
  148.  
  149. <%=nav.title%>
  150. <%=nav.name%>
  151. <%=nav.freq%>
  152. <%=nav.lat%>
  153. <%=nav.lng%>
  154. <%=nav.type%> 2=NDB 3=VOR 4=DME 5=FIX 6=TRACK
  155. */
  156. ?>
  157. <script type="text/html" id="navpoint_bubble">
  158. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  159. <strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br />
  160. <strong>Type: </strong>
  161. <?php /* Show the type of point */ ?>
  162. <% if(nav.type == 2) { %> NDB <% } %>
  163. <% if(nav.type == 3) { %> VOR <% } %>
  164. <% if(nav.type == 4) { %> DME <% } %>
  165. <% if(nav.type == 5) { %> FIX <% } %>
  166. <% if(nav.type == 6) { %> TRACK <% } %>
  167. <br />
  168. <?php /* Only show frequency if it's not a 0*/ ?>
  169. <% if(nav.freq != 0) { %>
  170. <strong>Frequency: </strong><%=nav.freq%>
  171. <% } %>
  172. </span>
  173. </script>
  174. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement