Jump to content

Fleet Table


AFVA | Mitchell

Recommended Posts

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

Link to comment
Share on other sites

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

http://forum.phpvms.net/topic/1522-fleet-table/

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

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

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

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

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;
}
?>

Link to comment
Share on other sites

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");
}

Link to comment
Share on other sites

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;
       }

Link to comment
Share on other sites

No, continue still needs to be there, otherwise you'll still get everything.

<?php $allaircraft = OperationsData::GetAllAircraft(); ?>
<?php foreach ($allaircraft as $aircraft)
{
			if($aircraft->icao != "Dash8"){
							continue;
			}

Link to comment
Share on other sites

  • 3 weeks later...

Hey Connor.

Check for 'pagination' on the forums. Some people have done it for the pilot list but it includes a lot of core file changes if I recall correctly. Though I think that some sort of pagination is planned for the next version of phpVMS which is still WIP. Again, if I recall correctly.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 7 months later...
  • 5 months later...
  • 3 months later...
  • 3 months 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...