Request: Flight Board

Is it possible to have a flight board that first checks the system time and then displays the following.

Flight Number - Departure ICAO - Arrival - Aircraft - Status

This would be eye candy, rather than actual status, since most of us have more flights than pilots. The board would display only flights with an arrival time within 2 hours of system time. Flight status would, depending onwhere they are in relation to system time, be on time, arriving, arrived.

I suppose something similar could be done for departures, but I’m trying to keep it as simple as possible.

Does this sound like something that could be done? Or, maybe I should ask if it has already been done.

Is it possible to have a flight board that first checks the system time and then displays the following.

Flight Number - Departure ICAO - Arrival - Aircraft - Status

This would be eye candy, rather than actual status, since most of us have more flights than pilots. The board would display only flights with an arrival time within 2 hours of system time. Flight status would, depending onwhere they are in relation to system time, be on time, arriving, arrived.

I suppose something similar could be done for departures, but I’m trying to keep it as simple as possible.

Does this sound like something that could be done? Or, maybe I should ask if it has already been done.

Sounds like a good idea! hopefully it can be done

Don’t laugh, but I am trying to do it. Looking at code from other pages, trying to figure out what variable names I need, with one eye on the monitor and the other on a book on PHP. The results, so far are either infuriating or hysterically funny. I don’t know which is worse. My approach is this:

Get the system time and convert it to the 24 hour format I’m using in the routes.

Get the routes with arrival times that are equal to or plus/minus one hour to the system time.

Display those routes in a table with flight number, departure and arrival ICAOs, a/c tail number and verbiage based on how far from the system time the arrival time is.

Sounds cool!!

Hope you will be succesful !

Regards,

Lucas

Don’t laugh, but I am trying to do it. Looking at code from other pages, trying to figure out what variable names I need, with one eye on the monitor and the other on a book on PHP. The results, so far are either infuriating or hysterically funny. I don’t know which is worse. My approach is this:

Get the system time and convert it to the 24 hour format I’m using in the routes.

Get the routes with arrival times that are equal to or plus/minus one hour to the system time.

Display those routes in a table with flight number, departure and arrival ICAOs, a/c tail number and verbiage based on how far from the system time the arrival time is.

Is this what you want to do?

http://xlvirtualairways.simmiles.com/arrivals.php

Similar, but instead of the last two columns, a column with verbiage such as on time, arriving, landed, arrived (based on schedule time vs. system time). That way, any time the page was loaded, different flights would be displayed. A departure board could be done similarly, with different status verbiage.

Similar, but instead of the last two columns, a column with verbiage such as on time, arriving, landed, arrived (based on schedule time vs. system time). That way, any time the page was loaded, different flights would be displayed. A departure board could be done similarly, with different status verbiage.

Well im defo interested. Something like that would be good

Yeah!

I would definately like this!

If you don’t mind I might have a go at this one also, I’ve been thinking about it for a while and have a good idea to make it realistic looking.

I certainly don’t mind, Tom, but you might want to look at this, before reinventing the wheel.

EDIT: That software won’t serve my needs. Back to trying to write code.

This is a pretty dirty way to do it (the sql query’s really need to be in a data class, not in the page) but you could build a module around it

<?php
$query = "SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC";
$list = DB::get_results($query);
echo '<h3>Upcoming Arrivals - Current Time is '.date('G:i').'</h3>';
echo '<table width="100%" border="1">';
echo '<tr><td>Departure</td><td>Arrival</td><td>Arrival Time</td><td>Aircraft</td><td>Status</td></tr>';
$count = 0;
foreach($list as $flight)
{
   if(($flight->arrtime + 0) > date('G:i'))
   {
       if($count < 5)
       {
           $aircraft = OperationsData::getAircraftInfo($flight->aircraft);
           echo '<tr><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->arrtime.'</td><td>'.$aircraft->fullname.'</td>';
           echo '<td>';
           if(($flight->arrtime - date('G:i')) <= 1)
           {
               echo 'Arriving Soon';
           }
           else
           {
               echo 'In Flight';
           }
           echo '</td></tr>';
           $count++;
       }
   }
}
echo '</table>';
?>

This will show the next 5 flights scheduled to arrive and is written to work with 24 hour date format, so if you are using 12 hour date format with am/pm in your schedules you will have to modify the date function.

It should look something like

Pretty plain but you can build it up how you would like and skin it.

Wow! That is what I’m looking for. Will give it a try and see if I can get it to work here. Thanks.

I wish I could report I’ve got it working, but if that happened, whatever would I do for the rest of the day.

I wish I could report I’ve got it working, but if that happened, whatever would I do for the rest of the day.

Is there any output at all? Do you have any schedules or aircraft? It works for me here on ver 934. If there is any error please post it.

I’ve obviously missed something I need to do, because it is only echoing the variables and some of the code. I don’t know my you know what from my elbow, when it comes to php.

This is the output I get. I obviously have failed to do something necessary. I have about 30 aircraft and 700 routes. I’ve spent all day adding routes, so at this point I can’t see straight. I’ll look at this again in the morning to see if I can figure what I screwed up.

Hi, It looks looke you are adding this via the add page in the admin section, just add the code in to the frontpage_main,tpl, when i tried earlier nothing was displayed in the table ill have another look at it again because like the post says its great eye candy

How strange is that, i have just done it again and its populated, it could be something to do with the time though, last night it was23:45 when i tried today its 11:04, ill let you know when it get to 13:00 if it still works.

I’ve obviously missed something I need to do, because it is only echoing the variables and some of the code. I don’t know my you know what from my elbow, when it comes to php.

This is the output I get. I obviously have failed to do something necessary. I have about 30 aircraft and 700 routes. I’ve spent all day adding routes, so at this point I can’t see straight. I’ll look at this again in the morning to see if I can figure what I screwed up.

Remember that this is php coding - it needs to be enclosed in php tags - ie <?php and ?>

I have changed the original post to include them - sorry.

How strange is that, i have just done it again and its populated, it could be something to do with the time though, last night it was23:45 when i tried today its 11:04, ill let you know when it get to 13:00 if it still works.

If this is what you guys are looking for I will have to mess with it a little. Right now it is just looking for upcoming flights between the current time and midnight, it does not look “around the corner” until after midnight.

Remember that this is php coding - it needs to be enclosed in php tags - ie <?php and ?>

I have changed the original post to include them - sorry.

I’m as dumb as I look. I forgot to add the tags. Now, it works.