Jump to content
artem

How to get aircraft icao knowing it's name

Recommended Posts

On my briefing page I have the following code which gives me aircraft's name from schedules:

<?php echo "{$schedule->aircraft}"; ?>

Which outputs something like this: A320-214

I can also use:

<?php echo "{$schedule->aircraftid}"; ?>

Which gives me an ID of an aircraft from *aircraft* table.

 

Knowing aircraft's name and id, how can I get aircraft icao code from *aircraft* database?

(In aircraft database there are fields *id*, *icao*, *name* etc)

Thanks!

Share this post


Link to post
Share on other sites

Is this what you're looking for?

<?php echo OperationsData::getAircraftInfo($schedules->aircraftid); ?>
<?php echo OperationsData::getAircraftByName($schedules->aircraft); ?>

 

Share this post


Link to post
Share on other sites
<?php
$aircraft = OperationsData::getAircraftInfo($schedules->aircraftid);
echo $aircraft->icao;
?>

Change $schedules->aircraftid to the aircraft id of your table, provided the id's match between the aircraft table and your table then it should work.

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×