<?php $flightcount = count($flights); ?>
<h3>Charters submitted by Pilots(<?php echo $flightcount; ?>)</h3>
<?php if($flightcount == '0')
{
echo "No Pilot submitted Flights found!";
return;
} ?>


<table cellspacing="0" cellpadding="0" border="0" class="tablesorter">
<tr>
<th>From</th>
<th>City</th>
<th>To</th>
<th>City</th>
<th>Aircraft</th>
<th>Tour Operator</th>
<th>Expires</th>
<th>Added By</th>
<th>Delete</th>
</tr>
<?php foreach($flights as $flight)
{
$pilotinfo = PilotData::getPilotData($flight->addedby);
$pilotidfinal = PilotData::GetPilotCode($pilotinfo->code, $pilotinfo->pilotid);
?>
<tr>
<td><?php echo $flight->depicao; ?></td>
<td><?php echo $flight->depname; ?></td>
<td><?php echo $flight->arricao; ?></td>
<td><?php echo $flight->arrname; ?></td>
<td><?php echo $flight->aircraftname; ?></td>
<td><?php echo $flight->tourop; ?></td>
<td><?php echo $flight->expiredate; ?></td>
<td><?php echo $pilotidfinal.' - '.$pilotinfo->firstname.' '.$pilotinfo->lastname; ?></td>
<td><a href="<?php echo SITE_URL ?>/admin/index.php/CharterOps/deleteflight/<?php echo $flight->cid; ?>">Delete</a></td>
</tr>
<?php } ?>
</table>