Jump to content

[SOLVED] List PIREPs


Connor1994

Recommended Posts

Try putting this into your profile.php file

$this->set('pireps', PIREPData::GetLastReports(Auth::$userinfo->pilotid, '10'));

Then in your profile_main.tpl file, add this table:

<table align="center" border="0" width="100%">
<thead>
	 <tr border="0">
 <th align="center">Flight</th>
 <th align="center">Depart</th>
 <th align="center">Arrival</th>
 <th align="center">Time</th>
 <th align="center">Landing Rate</th>
	 </tr>
 </thead>
 <tbody>
 <?php

if(count($pireps) > 0)
{
foreach($pireps as $flight)
 {
echo '<tr><th>'.$flight->flightnum.'</th>
<th>'.$flight->depicao.'</th>
<th>'.$flight->arricao.'</th>
<th>'.date(DATE_FORMAT, strtotime($flight->submitdate)).'</th>
<th>'.$flight->landingrate.'</th>
</tr>';

 }
else
{
 echo "<tr><td>There are no recent flights!</td></tr>";
}
?>
</tbody>
</table>

This hasn't being tested so I am not 100% certain if it will work or not.

Hope this help! :)

Kindest Regards,

James

Link to comment
Share on other sites

Try putting this into your profile.php file

$this->set('pireps', PIREPData::GetLastReports(Auth::$userinfo->pilotid, '10'));

Then in your profile_main.tpl file, add this table:

<table align="center" border="0" width="100%">
<thead>
	 <tr border="0">
 <th align="center">Flight</th>
 <th align="center">Depart</th>
 <th align="center">Arrival</th>
 <th align="center">Time</th>
 <th align="center">Landing Rate</th>
	 </tr>
 </thead>
 <tbody>
 <?php

if(count($pireps) > 0)
{
foreach($pireps as $flight)
 {
echo '<tr><th>'.$flight->flightnum.'</th>
<th>'.$flight->depicao.'</th>
<th>'.$flight->arricao.'</th>
<th>'.date(DATE_FORMAT, strtotime($flight->submitdate)).'</th>
<th>'.$flight->landingrate.'</th>
</tr>';

 }
else
{
 echo "<tr><td>There are no recent flights!</td></tr>";
}
?>
</tbody>
</table>

This hasn't being tested so I am not 100% certain if it will work or not.

Hope this help! :)

Kindest Regards,

James

I'll let you know.

You want a page with only pirep accepted and a second page with only pirep rejected for pilot??

I'm not bothered, either or

Link to comment
Share on other sites

James, I get this error message:

Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\dev\vms\lib\skins\###\profile_main.tpl on line 236

	  <?php

if(count($pireps) > 0)
{
foreach($pireps as $flight)
	 {
echo '<tr><th>'.$flight->flightnum.'</th>
<th>'.$flight->depicao.'</th>
<th>'.$flight->arricao.'</th>
<th>'.date(DATE_FORMAT, strtotime($flight->submitdate)).'</th>
<th>'.$flight->landingrate.'</th>
</tr>';
	 }
       else
       {
	 echo "<tr><td>There are no recent flights!</td></tr>";
}
?>

Link to comment
Share on other sites

There is one } missing from the code. :)

			 <?php

if(count($pireps) > 0)
{
foreach($pireps as $flight)
			 {
echo '<tr><th>'.$flight->flightnum.'</th>
<th>'.$flight->depicao.'</th>
<th>'.$flight->arricao.'</th>
<th>'.date(DATE_FORMAT, strtotime($flight->submitdate)).'</th>
<th>'.$flight->landingrate.'</th>
</tr>';
			 }
} //<- this one
		 else
		 {
			 echo "<tr><td>There are no recent flights!</td></tr>";
}
?>

Link to comment
Share on other sites

  • 2 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...