G’day all,
I am working on a advanced fleet page at the moment and ran into a problem.
I want the ICAO, Type, Registration, Range, Empty Weight, Cruise Alt, Max Pax, Max Cargo, Total Hours, Total Distance Flown and Total Flight Time.
The problem is that i am trying to use both OperationsData (for ICAO to Total Hours) and StatsData (for Total Distance and Total Flight Time) in one table which is getting hard.
My code without StatsData
<?php $allaircraft = OperationsData::GetAllAircraft(); ?>
<?php
if(!$allaircraft)
{
echo '<p id="error">No aircraft have been added</p>';
return;
}
?>
<table border="1">
<thead>
<tr><td><b>ICAO</b></td><td><b>Type</b></td><td><b>Registration</b></td><td><b>Range</b></td><td><b>Empty Weight</b></td><td><b>Cruise Alt</b></td><td><b>Max Pax</b></td><td><b>Max Cargo</b></td><td><b>Total Hours</b></td></tr>
</thead>
<tbody>
<?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>
Can someone please tell me if it is possible to have two different arrays in one table?
Thanks in advance,
Mitchell
(I have finally worked out how to make modules, may help when comes to coding. Fleet.php can be posted on request)