Colin,
If you want to get this done you have to go step by step not just copy some codes from some pages and paste it where you want as it's not gonna work for sure, so first off you will need a variable to search through the PIREPS based on the pilot id then use a foreach loop to get those data out of the DB then you design a table and put the info in it, so here is the code:
<?php
$pilotid = Auth::$userinfo->pilotid;
$reports = PIREPData::getLastReports($pilotid, 5,'');
?>
<table width="100%">
<tr>
<th>Flight Number</th>
<th>Departure</th>
<th>Arrival</th>
<th>Status</th>
<?php
if(Auth::LoggedIn() && Auth::$userinfo->pilotid == $userinfo->pilotid)
{
echo '<th>Options</th>';
}
?>
</tr>
<?php
foreach($reports as $report)
{
?>
<tr>
<td align="center"><a href="<?php echo url('/pireps/view/'.$report->pirepid);?>"><?php echo $report->code . $report->flightnum; ?></a></td>
<td align="center"><?php echo $report->depicao; ?></td>
<td align="center"><?php echo $report->arricao; ?></td>
<td align="center"><?php
if($report->accepted == PIREP_ACCEPTED)
echo '<div id="success">Accepted</div>';
elseif($report->accepted == PIREP_REJECTED)
echo '<div id="error">Rejected</div>';
elseif($report->accepted == PIREP_PENDING)
echo '<div id="error">Approval Pending</div>';
elseif($report->accepted == PIREP_INPROGRESS)
echo '<div id="error">Flight in Progress</div>';
?></td>
<?php
if(Auth::LoggedIn() && Auth::$userinfo->pilotid == $report->pilotid)
{
?>
<td align="center"><a href="<?php echo url('/pireps/addcomment?id='.$report->pirepid);?>">Add Comment</a><br /></td>
<?php
}
}
?>
</tr>
</table>
Screenshot:
Now this will show only last 5 flights. If you want to show more flights change "5" to whatever number you want.