ukmil Posted December 7, 2011 Report Posted December 7, 2011 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. Quote
steve Posted December 8, 2011 Report Posted December 8, 2011 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 Quote
ukmil Posted December 8, 2011 Report Posted December 8, 2011 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 /> Quote
steve Posted December 12, 2011 Report Posted December 12, 2011 Thank you very much for sharing . I will let you know how I get on. regards, Steven Quote
druptown Posted January 27, 2012 Report Posted January 27, 2012 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. Quote
mattsmith Posted January 28, 2012 Report Posted January 28, 2012 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 Quote
Txmmy83 Posted June 19, 2012 Report Posted June 19, 2012 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 Quote
Txmmy83 Posted June 19, 2012 Report Posted June 19, 2012 thanks to nabeel http://forum.phpvms.net/topic/2251-jquery-lightbox/page__hl__lightbox__fromsearch__1 Quote
Curshad Posted July 20, 2012 Report Posted July 20, 2012 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. Quote
Curshad Posted July 20, 2012 Report Posted July 20, 2012 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) Quote
Tom Posted July 20, 2012 Report Posted July 20, 2012 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; } ?> Quote
Curshad Posted July 20, 2012 Report Posted July 20, 2012 Hmm Ok, i'll giv it a shot. Thanks! Tom Quote
Curshad Posted July 20, 2012 Report Posted July 20, 2012 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"); } Quote
Tom Posted July 20, 2012 Report Posted July 20, 2012 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; } Quote
Curshad Posted July 20, 2012 Report Posted July 20, 2012 Right, I did find it and replace it, but im asuming { // Or whatever you entered as the ICAO for a dash 8 continue; doesn't have to be there so would it actually look like?? { if($aircraft->icao != "Dash8"); } Quote
Tom Posted July 20, 2012 Report Posted July 20, 2012 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; } Quote
Connor1994 Posted August 8, 2012 Report Posted August 8, 2012 Hi, In our fleet there is over 200 aircraft, is there a way to have the list show only a certain number of aircraft, then have a next button below so members can scroll through the table as opposed to the list extending the page? Cheers CS Quote
Sava Posted August 8, 2012 Report Posted August 8, 2012 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. 1 Quote
mattsmith Posted November 8, 2012 Report Posted November 8, 2012 How do you get this to show up on your website so u can click on it and then see the fleet? Quote
Josf Posted July 2, 2013 Report Posted July 2, 2013 hello I do not know much about websites I have this problem only in this page Quote
t_bergman Posted July 9, 2013 Report Posted July 9, 2013 Does anyone know how to change the format of the total time the aircraft has? Quote
DanL Posted December 30, 2013 Report Posted December 30, 2013 Hi I have been trying for awhile to figure this out without much success. I am still very new to this Is it possible to take out the download column? And if you can how do you? thanks Quote
Moderators servetas Posted April 9, 2014 Moderators Report Posted April 9, 2014 This is a quite old module. I would suggest you to use Vanser's one. http://forum.phpvms.net/topic/7937-vfleettracker-v13/ Quote
chilemugriento Posted July 22, 2014 Report Posted July 22, 2014 I noticed some kind of bug Total time per aircraft stops at 838:59:59 hrs (same as Virtual Airline total flight time in FSPassengers default table) http://www.surair.com.mx/phpvms/index.php/Fleet Any solution ? I will apreciate help. Best regards Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.