Fleet Table

I forgot to add that it was a manual file. No acars. So it would have to take what I put in as flight time and the admin center as well as profile and the database did. But for one reason or the other it shows the plane 8 minutes short on flight time.

hi

I get error

Warning: Invalid argument supplied for foreach() /core/templates/fleet_table.tpl on line 21

seems to be to do with

<?php foreach ($fleet as $aircraft)

update

i have now got this to work HOWEVER, it only shows 3 of my aircraft when I do have ALOT more than just 3 enabled

have now managed to get this to work

I have been tweaking my Fleet page, and now have it so it splits the aircraft into groups, and lists the unavailable ones at the bottom, as under maint

UKMIL, would you mind sharing how you grouped by type?

Thanks

Steve

i could try, by my file is heavily modified for my site, and it is not easily made into a generic file that will suit all.

If you want me to make one for your site specific, I could.

Thanks,

I have used another of your posts for the code in fleet_table.tpl and I am sorting the data in fleet.php using

GROUP BY a.name, a.registration';

which sorts the aircraft by type then registration which means I have 50 or so aircraft in my available group as one big long list, what I can not work out is how to get the table to group them into groups based on type, so you can see instantly these are 737-800’s, these are B767’s etc.

cheers,

Steven

steve, as I said, it is not easy, and takes manual amendment for every new type.

you basically, take the stock file as it is, which shows them all, but add an IF statement. It is prob not the best way as it uses a lot of code, but I could not figure out another way.

so, for each type, you need this

<thead>

<tr>

<h4>VICTOR K2’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“VICTOR K2”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

they key line is

if($aircraft->name<>“VICTOR K2”) { continue; };

so, in my top group, it will bypass every aircraft that is NOT a Victor K2.

you then have to repeat this code for every other type, so my complete fleet file is

<style type=“text/css”>

<!–

th {

color: #ff8710;

font-family: “Trebuchet MS”, Arial, Helvetica, sans-serif;

font-weight: bolder;

font-size: 14px;

}

td {

color: #000000;

font-family: “Trebuchet MS”, Arial, Helvetica, sans-serif;

font-size: 14px;

font-weight: normal;

}

–>

</style>

<h1><?php echo SITE_NAME?> Fleet Availability</h1>

<!-- Fleet Table Version 2.0.- - fleet_table.tpl - By Mitchell W

CHANGES FROM 1.1:

Added image

Added download

–>

<td align=“center”>

<h4>AIRCRAFT CURRENTLY IN USE - PLEASE CHOOSE AN AVAILABLE FROM BELOW FOR FOR YOUR FLIGHT</h4></td>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th align=“center” style=“background-color: #171717; width: 3.5%;”> </th>

<th width=“20%” align=“center” style=“background-color: #171717;”>Pilot</th>

<th width=“20%” align=“center” style=“background-color: #171717;”>Aircraft</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“18.5%” align=“center” style=“background-color: #171717;”>Status</th>

</tr>

<?php

$results = ACARSData::GetACARSData();

if (count($results) > 0)

{

foreach($results as $flight)

{

?>

<tr>

<td></td>

<td align=“center”><?php echo $flight->pilotname;?></td>

<td align=“center”><?php echo $flight->aircraftname;?></td>

<td style=“font-weight: bolder;”><?php echo $flight->aircraft; ?></td>

<td align=“center”><?php if($flight->phasedetail

!= ‘Paused’) { echo $flight->phasedetail; }

else { echo “Cruise”; }?></font></td>

</tr>

<?php

}

} else { ?>

<tr><td width=“20%” align=“center” colspan=“6” style=“padding: 5px; font-size: 13px; font-weight: bold; color: #ff961e;”>No Aircraft Currently Flying</td></tr>

<?php

}

?>

</table>

<table border=“0”>

<thead>

<tr>

<h4>VICTOR K2’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“VICTOR K2”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>TRISTAR’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“TRISTAR”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<thead>

<tr>

<h4>VC-10’s AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“VC-10”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>C130K HERCULES AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“C130K”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>BOEING C17’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“BOEING C17”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>BOEING E3-D’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“E-3D”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>BAE NIMROD MR2’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“NIMROD MR2”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>PANAVIA TORNADO F3’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“TOR F3”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>PANAVIA TORNADO GR4’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“TOR GR4”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>BAE HARRIER’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“HARRIER GR9”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>JAGUAR’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“JAGUAR GR3”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>BOEING CH47 CHINOOK’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“CH47-D”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<h4>GAZELLE AH1’S AVAILABLE FOR FLIGHT FROM LOCATION LISTED</h4><td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“10%” align=“center” style=“background-color: #171717;”>Image</th>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Sorties</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Min Rank to Fly</th>

</tr>

</thead>

<tbody>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==1)

{if($aircraft->registration==“PM”) { continue; };if($aircraft->registration==“-”) { continue; }

if($flight->aircraft==$aircraft->registration){continue;}

if($aircraft->name<>“GAZELLE AH1”) { continue; };

?>

<tr>

<td><img src=“<?php echo $aircraft->imagelink; ?>”></td>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<td><?php echo $aircraft->routesflown; ?></td><?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php if($aircraft->minrank==5){echo “Wing Commander”;} elseif ($aircraft->minrank==4){echo “Squadron Leader”;} elseif ($aircraft->minrank==2){echo “Flying Officer”;}elseif ($aircraft->minrank==3){echo “Flight Lieutenant”;}else {echo “Pilot Officer”;}?></td>

</tr>

<?php } ?>

<table border=“0”>

<thead>

</thead>

<tr>

<td align=“center”>

<table style=“border:1px solid grey;” cellspacing=“0” cellpadding=“0” bgcolor=“#ffffff”>

<tr>

<th width=“15%” align=“center” style=“background-color: #171717;”>Type</th>

<th width=“5%” align=“center” style=“background-color: #171717;”>Reg</th>

<th width=“10%” align=“center” style=“background-color: #171717;”>Hours used</th>

<th width=“20.5%” align=“center” style=“background-color: #171717;”>Location</th>

<th width=“28.5%” align=“center” style=“background-color: #171717;”>Status</th>

</tr>

<h4> AIRCRAFT BELOW ARE UNDER MAINTENANCE AND CANNOT BE FLOWN AT THIS TIME</h4>

<?php foreach ($fleet as $aircraft) If($aircraft->enabled==0)

{

?>

<tr>

<td><?php echo $aircraft->name; ?> </td>

<td style=“font-weight: bolder;”><?php echo $aircraft->registration; ?></td>

<td><?php echo $aircraft->totaltime; ?></td>

<?php

$params = (array(‘a.registration’=>$aircraft->registration, ‘p.accepted’=>PIREP_ACCEPTED));

$pirep = PIREPData::findPIREPS($params);

$current_location2 = $pirep[0]->arrname;

?>

<td style=“font-weight: bolder;”><?php echo $current_location.‘’.$current_location2; ?></td>

<td><?php If($aircraft->enabled==1){echo “AVAILABLE”;} else {echo “UNDER MAINTENANCE”;}?></td>

</tr>

<?php } ?>

</tbody>

</table>

<br />

Thank you very much for sharing . I will let you know how I get on.

regards,

Steven

HI

How can I show Fleet by airlines ?

I’ll bump this one since it isn’t really answered…and because I’ve got the same question.

How do you get this to show up on your website so u can click on it and then see the fleet?

Its ok figured it out

I have a question is it possible that if you click on a aircraft fullname to open a picture/screenshot of the Particular aircraft

http://www.flyeurope-va.org/index.php/fleet

I have it realized on my fleet page

but now my question is it possible to open the picture with Slimbox or Lightbox and any tips how to integrate?

best regards and thanks in advance,

Thomas

thanks to nabeel

Hey can some one help me out here??

You know this code

<?php $allaircraft = OperationsData::GetAllAircraft(); ?>
<?php foreach ($allaircraft as $aircraft)
{
?>

Displays Alll aircrafts

So when this

<tr bgcolor="#FFFFFF">
<td><?php echo $aircraft->icao; ?> </td>
<td><?php echo $aircraft->registration; ?> </td>
<td><?php echo $aircraft->fullname; ?> </td>
<td><?php echo $aircraft->range; ?> </td>
<td><?php echo $aircraft->weight; ?> </td>
<td><?php echo $aircraft->cruise; ?> </td>
<td><?php echo $aircraft->maxpax; ?> </td>
<td><?php echo $aircraft->maxcargo; ?> </td>

Is present it shows all aircrafts for each DifferentCatergory, I want to change that to dis play a speicfic aircraft , for example the dash 8.

So i was hurting my head thinking if i did this

<?php foreach ($Bombardier Dash 8 Q300 as $aircraft)

would this be correct?? Would that work? Please some one help me out.

I think thats how Qantas did there fleet (http://qantasvirtual.com/index.php/fleet), But i only want it all in one tab (not in multiple tabs like Qantas)

I guess this would work as a quick-fix; wouldn’t be particularly efficient though

<?php $allaircraft = OperationsData::GetAllAircraft(); ?>
<?php foreach ($allaircraft as $aircraft)
{
if($aircraft->icao != "Dash8"){ // Or whatever you entered as the ICAO for a dash 8
	continue;
}
?>

Hmm Ok, i’ll giv it a shot. Thanks! Tom

I’m Sorry Tom but how would i fill out the rest?

<td><?php echo $aircraft->registration; ?> </td>
<td><?php echo $aircraft->fullname; ?> </td>
<td><?php echo $aircraft->range; ?> </td>
<td><?php echo $aircraft->weight; ?> </td>
<td><?php echo $aircraft->cruise; ?> </td>
<td><?php echo $aircraft->maxpax; ?> </td>
<td><?php echo $aircraft->maxcargo; ?> </td>

would it be like this?

<?php $allaircraft = OperationsData::GetAllAircraft(); ?>
<?php foreach ($allaircraft as $aircraft)
{
    if($aircraft->icao != "Dash8");
    if($aircraft->registration != "C6-BFP");
    if($aircraft->range != "830nm");
    if($aircraft->weight != "22100lbs");
    if($aircraft->cruise != "287kts");
    if($aircraft->max pax != "50");
    if($aircraft->max cargo != "41100");
}

It doesn’t require filling out, those are what displays the data.

Find

<?php $allaircraft = OperationsData::GetAllAircraft(); ?>
<?php foreach ($allaircraft as $aircraft)
{

Replace

<?php $allaircraft = OperationsData::GetAllAircraft(); ?>
<?php foreach ($allaircraft as $aircraft)
{
       if($aircraft->icao != "Dash8"){ // Or whatever you entered as the ICAO for a dash 8
               continue;
       }