Jump to content

Show how many flights per airline for a pilot


Parkho

Recommended Posts

  • Moderators

Here is a small code that you can use in pilot center or public profile. It shows total flights in a particular airline that pilot has flown.

Note: If your database table prefix is not phpvms, change this part "phpvms_pireps" to yours in the code.

Enjoy ;)

<table class="balancesheet" width="50%">
<tr class="balancesheet_header">
<td colspan="2">Airline Flight Count For a Pilot</td>
</tr>
<tr>
<td align="center"><strong>Airline Name</strong></td>
<td align="center"><strong>Flight Count</strong></td>
</tr>
<?php
$airlines = OperationsData::getAllAirlines();
foreach($airlines as $airline)
{
?>
<tr>
<td align="center"><?php echo $airline->name ;?></td>
<td align="center">
<?php
$pilotid = Auth::$userinfo->pilotid;
$code = $airline->code;
$qry =" SELECT count(pilotid) AS total FROM phpvms_pireps WHERE pilotid='$pilotid' AND code='$code'");
$row = DB::get_row($qry);
echo $row->total;
?>
</td>
</tr>
<?php
}
?>
</table>

Screenshot:

count.png

  • Like 1
Link to comment
Share on other sites

  • 1 year 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...