Jump to content

Current flights -> frontpage


Laura

Recommended Posts

I'd like to view the current flights on the frontpage in a box like the "Recent Pilots" & "Recent Pireps" Boxes, shown as "Flight number - Dep - Arr."

I guess i have to get the code from the /acars page and simply exclude the map and all the stats (name, status, speed, dist/time remaining) i don't want to show .. ?

If yes, where to get that code from ?

And if no, where's my mistake ?

Link to comment
Share on other sites

Hi Laura,

Paste the below into your frontpage_main.tpl where you want the table to display. That should work ok... hopefully :)

 <div class="left_block_wide">
<h2 class="home_title style4">Pilots Flying Now </span></h2>
	 <table width="920" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border:1px solid grey;">
			 <tr>
			 <th colspan="6" align="center" bgcolor="#FF9900" style="background-color: #FF9900; width: 3.5%;"><div align="left"></div></th>
			 </tr>
			 <tr>
			 <th align="center" bgcolor="#CC0000" style="background-color: #CC0000; width: 3.5%;"><span class="style8"></span></th>
			 <th width="10%" align="center" bgcolor="#CC0000" class="style1" style="background-color: #CC0000;"><span class="style12">Flight</span></th>
			 <th width="30%" align="center" bgcolor="#CC0000" class="style1" style="background-color: #CC0000;"><span class="style12">Origin </span></th>
			 <th width="30%" align="center" bgcolor="#CC0000" class="style1" style="background-color: #CC0000;"><span class="style12">Destination</span></th>
			 <th align="center" bgcolor="#CC0000" class="style1" style="background-color: #CC0000;"><span class="style12">Status</span></th>
			 <th width="15%" align="center" bgcolor="#CC0000" style="background-color:#CC0000;"> </th>
			 </tr>
			 <?php
$results = ACARSData::GetACARSData();
if (count($results) > 0)
{
foreach($results as $flight)
 {

	 ?>
			 <tr>
			 <td height="33" align="center"> </td>
			 <td align="center"><font size="3" color="#852025" face="digi"><font style="text-transform:uppercase"><?php echo $flight->flightnum;?></font></td>
			 <td align="center"><font size="3" color="#852025" face="digi"><font style="text-transform:uppercase"><?php echo $flight->depname;?></font></td>
			 <td align="center"><font size="3" color="#852025" face="digi"><font style="text-transform:uppercase"><?php echo $flight->arrname;?></font></td>
			 <td align="center" background=""><font size="3" color="#852025" face="digi"><font style="text-transform:uppercase">
				 <?php if($flight->phasedetail
!= 'Paused') { echo $flight->phasedetail; }
else { echo "Cruise"; }?>
			 </font></td>
			 </tr>
			 <?php		
		 }
	 } else { ?>
			 <tr>
			 <center>
				 <td width="20%" colspan="5" align="center" style="padding: 5px; font-size: 13px; font-weight: bold; color: #852025;">No Pilots Currently Flying. </td>
			 </center>
			 </tr>
			 <?php
	 }
	 ?>
		 </table>
</div>

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

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