Moderators Parkho Posted September 18, 2012 Moderators Report 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
ATAvCEO Posted September 19, 2012 Report Posted September 19, 2012 Nice code parkho, thanks for sharing it Quote
Moderators Parkho Posted September 19, 2012 Author Moderators Report Posted September 19, 2012 ty Quote
michael Kraan Posted October 10, 2013 Report 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
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.