Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //Get the SQL data from the system
- $pireps = DB::get_results("SELECT DISTINCT depicao, DISTINCT arricao FROM " . TABLE_PREFIX . "pilots WHERE pilotid = " . Auth::$userinfo->pilotid);
- $airports = DB::get_results("SELECT * FROM " . TABLE_PREFIX . "airports");
- $sz = sizeof($pireps_by_icao);
- $pireps_by_icao = array();
- if($sz > 0) {
- foreach($pireps as $pirep) {
- if($pireps_by_icao[$pirep->depicao] == '')
- $pireps_by_icao[$pirep->depicao] = 'true';
- if($pireps_by_icao[$pirep->arricao] == '')
- $pireps_by_icao[$pirep->arricao] = 'true';
- }
- }
- foreach($airports as $airport) {
- if($sz > 0 || $pireps_by_icao[$airport->icao] == 'true'):
- ?>
- FLOWN TO AIRPORT: <?php echo($airport->icao . " - " . $airport->name); ?>
- <?php
- else:
- ?>
- HAVEN'T FLOWN TO AIRPORT: <?php echo($airport->icao . " - " . $airport->name); ?>
- <?php
- endif;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement