Moderators Parkho Posted September 18, 2012 Moderators Report Share Posted September 18, 2012 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: 1 Quote Link to comment Share on other sites More sharing options...
ATAvCEO Posted September 19, 2012 Report Share Posted September 19, 2012 Nice code parkho, thanks for sharing it Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted September 19, 2012 Author Moderators Report Share Posted September 19, 2012 ty Quote Link to comment Share on other sites More sharing options...
iva Posted September 21, 2012 Report Share Posted September 21, 2012 thanks a lot Quote Link to comment Share on other sites More sharing options...
michael Kraan Posted October 10, 2013 Report Share Posted October 10, 2013 parkho, The code is not working he say error on this line: $qry =" SELECT count(pilotid) AS total FROM phpvms_pireps WHERE pilotid='$pilotid' AND code='$code'"); but my database is good. = phpvms_pireps Hope you can help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.