Jump to content

question


joeri

Recommended Posts

  • Moderators

i got this from Nabeel but i can't get it to work or even get something on my screen

can somebody help me plz

$allaircraft = OperationsData::GetAllAircraft();

echo '<table>';

foreach ($allaircraft as $aircraft)

{

  echo '<tr>';

  echo '<td>';

  // do each row

  echo '</td></tr>';

}

echo '</table>';

Link to comment
Share on other sites

Add this to the page you are working on:

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

Link to comment
Share on other sites

  • 4 weeks 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...