Txmmy83 Posted April 14, 2011 Report Posted April 14, 2011 dicovered another thing but may only suitable for Airlines which have not many Airports in database first of all the country code follows the toplevel domains for each country at least most do! ok you could even but larger or more styled flags (just name it with full country name) the get method looks only for the name.png remember for example United Arab Emirates.png would not work it have to be united arab emirates.png since the img routine cant read Caps best regards Thomas Quote
flyalaska Posted May 17, 2011 Report Posted May 17, 2011 friends got it work example here: http://www.flyeurope-va.org/index.php/airports country flag of Yugoslavia/Serbia is missing in phpVMS command back it is there under "RS" wich is serbia and montenegro only modification need to do is rename your countries to two letter codes best way to get all of them is to go into source code and from registration form you can derive all necessary "option values" then use <img src="<?php echo Countries::getCountryImage($airport->country);?>"/> to get the image Best Regards Thomas Can you tell me how to display the number of times a destination has had a flight to that airport? Quote
Administrators simpilot Posted May 17, 2011 Administrators Report Posted May 17, 2011 @FlyAlaska You can build a little data class to count the pireps to that airport. Maybe this -> file AirportData.class.php in core/common <?php class AirportData extends CodonData { function get_number_flights($icao) { $sql = 'SELECT pirepid FROM '.TABLE_PREFIX.'pireps WHERE arricao="'.$icao.'"'; $result = DB::get_results($sql); return count($result); } } Then in your template call it out like this -> <?php echo 'Total Arrivals To KJFK: '.AirportData::get_number_flights('KJFK'); ?> Quote
flyalaska Posted May 17, 2011 Report Posted May 17, 2011 @FlyAlaska You can build a little data class to count the pireps to that airport. Maybe this -> file AirportData.class.php in core/common <?php class AirportData extends CodonData { function get_number_flights($icao) { $sql = 'SELECT pirepid FROM '.TABLE_PREFIX.'pireps WHERE arricao="'.$icao.'"'; $result = DB::get_results($sql); return count($result); } } Then in your template call it out like this -> <?php echo 'Total Arrivals To KJFK: '.AirportData::get_number_flights('KJFK'); ?> Thank you Dave! 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.