Jump to content

Recommended Posts

Posted

Hello,

I would like to show Live flight data on a different page that I created, and I do require to show this page with a custom module called Ops.php

Can anyone help me with this.

Posted

Hey,

Copy your page's source and create a template with your soruce. After that, Maybe this could work:

<?php
Template::Show('nameoftemplate.tpl');
?>

Thanks!

Posted

Hello,

I have already created the Module and the page, And when I view vasite.com/action.php/Ops/page I can view my page, all i need to do is include the Acars live flight data in a table

Posted

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

  • 11 months later...
  • Administrators
Posted

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.

Posted

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

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...