Advertisement
Guest User

Untitled

a guest
May 27th, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php //Get the SQL data from the system
  2. $pireps = DB::get_results("SELECT DISTINCT depicao, DISTINCT arricao FROM " . TABLE_PREFIX . "pilots WHERE pilotid = " . Auth::$userinfo->pilotid);
  3. $airports = DB::get_results("SELECT * FROM " . TABLE_PREFIX . "airports");
  4.  
  5. $sz = sizeof($pireps_by_icao);
  6.  
  7. $pireps_by_icao = array();
  8. if($sz > 0) {
  9. foreach($pireps as $pirep) {
  10. if($pireps_by_icao[$pirep->depicao] == '')
  11. $pireps_by_icao[$pirep->depicao] = 'true';
  12. if($pireps_by_icao[$pirep->arricao] == '')
  13. $pireps_by_icao[$pirep->arricao] = 'true';
  14. }
  15. }
  16. foreach($airports as $airport) {
  17. if($sz > 0 || $pireps_by_icao[$airport->icao] == 'true'):
  18. ?>
  19. FLOWN TO AIRPORT: <?php echo($airport->icao . " - " . $airport->name); ?>
  20. <?php
  21. else:
  22. ?>
  23. HAVEN'T FLOWN TO AIRPORT: <?php echo($airport->icao . " - " . $airport->name); ?>
  24. <?php
  25. endif;
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement