Jump to content

Airport Tables


Adamm

Recommended Posts

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

Link to comment
Share on other sites

  • 1 month later...

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?

Link to comment
Share on other sites

  • Administrators

@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'); ?>

Link to comment
Share on other sites

@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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...