CrashGordon Posted May 1, 2010 Report Share Posted May 1, 2010 It occurs to me that php VMS provides a page to publicly list pilots and hubs, but none to list the fleet. I think that might be a nice feature. You know, ICAO code, full a/c name , tail number, and an option for a graphic. Until that happens, does anyone care to share an example of such a page. At my age, I'm too old a dog to learn new tricks. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 1, 2010 Administrators Report Share Posted May 1, 2010 There's an addon in the addon forum for this Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted May 1, 2010 Author Report Share Posted May 1, 2010 Thank you very much for pointing that out. I had missed it the first time I looked. The tread was entitled question and I didn't need more of those. That works very well, but I'll need to delete aircraft I don't want to display, rather than de-activate them, but that isn't a problem. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted May 1, 2010 Report Share Posted May 1, 2010 You do not need to delete the aircraft to not have the display. You can just disable them and may sure the loop continues if it sees the aircraft as diabled. I have now looked at the code in a long time but if you stick something like this in the loop it should not display disabled aircraft. if($aircraft->enabled == '0') continue; I will look at the code and post a better look Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted May 1, 2010 Report Share Posted May 1, 2010 Unless I modified the template the above should work. Just but it inside of the {} brackets after the foreach($fleet as $aircraft) It should look like this foreach($fleet as $aircraft) { if($aircraft->enabled == '0') continue; Quote Link to comment Share on other sites More sharing options...
CrashGordon Posted May 1, 2010 Author Report Share Posted May 1, 2010 I'm not sure we are talking about the same code. This is the one I found. If there is another one I should be looking at, let me know <?php $allaircraft = OperationsData::GetAllAircraft(); ?> <?php if(!$allaircraft) { echo '<p id="error">No aircraft have been added</p>'; return; } ?> <table border="1"> <thead> <?php //thead Is the top of the table ?> <tr><td><b>ICAO</b></td><td><b>Type</b></td><td><b>Registration</b></td><td><b>Range</b></td><td><b>Weight</b></td><td><b>Cruise</b></td><td><b>Max Pax</b></td><td><b>Max Cargo</b></td></tr> </thead> <tbody> <?php //below is all the info for each aircraft ?> <?php foreach ($allaircraft as $aircraft) { ?> <tr> <td><?php echo $aircraft->icao; ?> </td> <td><?php echo $aircraft->name; ?> </td> <td><?php echo $aircraft->registration; ?></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> </tr> <?php } ?> </tbody> </table> Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted May 1, 2010 Report Share Posted May 1, 2010 I'm not sure we are talking about the same code. This is the one I found. If there is another one I should be looking at, let me know <?php $allaircraft = OperationsData::GetAllAircraft(); ?> <?php if(!$allaircraft) { echo '<p id="error">No aircraft have been added</p>'; return; } ?> <table border="1"> <thead> <?php //thead Is the top of the table ?> <tr><td><b>ICAO</b></td><td><b>Type</b></td><td><b>Registration</b></td><td><b>Range</b></td><td><b>Weight</b></td><td><b>Cruise</b></td><td><b>Max Pax</b></td><td><b>Max Cargo</b></td></tr> </thead> <tbody> <?php //below is all the info for each aircraft ?> <?php foreach ($allaircraft as $aircraft) { ?> <tr> <td><?php echo $aircraft->icao; ?> </td> <td><?php echo $aircraft->name; ?> </td> <td><?php echo $aircraft->registration; ?></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> </tr> <?php } ?> </tbody> </table> Basically the same thing <?php foreach ($allaircraft as $aircraft) { if($aircraft->enabled == '0') continue; Just add the bottom line Quote Link to comment Share on other sites More sharing options...
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.