Jump to content

Include ACARS/Live Flight data in a separate page


Kishshey

Recommended Posts

I'm not 100% sure, however, just open the file "ACARS.php" and add

public function live()

{

$this->set('acarsdata', ACARSData::GetACARSData());

$this->render('live.tpl');

}

done that already, no luck, so far i noticed the acarsmap.tpl page uses js to create the body of the table, i tried the same thing

I added this to my ACARS.php

public function live()
   {
    $this->title = 'Live Map';
    $this->set('acarsdata', ACARSData::GetACARSData());
    $this->render('live.tpl');

And included this table in live.tpl, just like it is in the acarsmap.tpl for testing

<table border = "0" class="table table-striped" width="100%" class="acarsmap">
<thead>
<tr>
 <td><b>Pilot</b></td>
 <td><b>Flight Number</b></td>
 <td><b>Departure</b></td>
 <td><b>Arrival</b></td>
 <td><b>Status</b></td>
 <td><b>Altitude</b></td>
 <td><b>Speed</b></td>
 <td><b>Distance/Time Remain</b></td>
</tr>
</thead>
<tbody id="pilotlist"></tbody>
</table>
<script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script>
<script type="text/html" id="acars_map_row">
<tr class="<%=flight.trclass%>">
<td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a></td>
<td><%=flight.flightnum%></td>
<td><%=flight.depicao%></td>
<td><%=flight.arricao%></td>
<td><%=flight.phasedetail%></td>
<td><%=flight.alt%></td>
<td><%=flight.gs%></td>
<td><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%></td>
</tr>
</script>

I'm sorry if i sound like a noob, I really am not good at this =D

Link to comment
Share on other sites

  • 11 months later...
  • Administrators

The code you are using builds a table using the javascript from the acars map which you have cut off. If you do not want the map, just a table, your best bet is probably to load the acars data into a variable like you are doing and then just loop through the data on the template page to create your table rows. Do not use any of the javascript functions, there is no need for them.

Link to comment
Share on other sites

The code you are using builds a table using the javascript from the acars map which you have cut off. If you do not want the map, just a table, your best bet is probably to load the acars data into a variable like you are doing and then just loop through the data on the template page to create your table rows. Do not use any of the javascript functions, there is no need for them.

Hello,

Perhaps could you give me an example? I appreciate your help

Link to comment
Share on other sites

  • Administrators

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...