Jump to content

Recommended Posts

Posted

So just to confirm.....this has nothing to do with live flights, right?! Just for displaying what would be going on in your schedule if it was really happenning?! Just so I tell my users the correct info. Works good, btw. :)

Nothing to do with reality.:D Just eye candy based on your schedule.

Posted

Awesome...now how do I change it so I get 10 returns instead of 5? Sorry if this was already asked.

You will find the following line in both the departure and arrival sections.

if($count < 5)

Change it to

if($count < 10)

Posted

See, that is what I thought, but seemed to obvious. I guess I could have tested that out easy enought, though. Sometimes I type before I really think it through :D

Posted

I just noticed that the times in my board are a bit off. For instance, a flight out of PHNL is showing a departure time that is 3 hours earlier than it should be. So, obviously something is wrong with my schedule or airport details?! When the .tpl file states:

echo '<h3>Expected Departures - Current Time is '.date('G:i').'</h3>';

Where is it getting the date info from? Maybe I need to fix something in my config?!

  • Administrators
Posted

I just noticed that the times in my board are a bit off. For instance, a flight out of PHNL is showing a departure time that is 3 hours earlier than it should be. So, obviously something is wrong with my schedule or airport details?! When the .tpl file states:

echo '<h3>Expected Departures - Current Time is '.date('G:i').'</h3>';

Where is it getting the date info from? Maybe I need to fix something in my config?!

Its your server time.

Posted

There is an issue with bumping the time one hour if it is between 23:00 and 23:59. It appears that data for flights that departed prior to 23:59 gets lost. While this might not be a big problem for departures, if there are long flights involved, arrivals are effected. What happens is while the flight is displayed, the times aren't. I will get a screen shot the next time it occurs. I checked my schedule. There are no enabled flights lacking departure, arrival and flight times. Could it be that the code for "departed" and "arrived", is attempting to pull data from the previous day? Sorry if I can't explain it better.

  • 2 weeks later...
Posted

Hi@all!

I like the Flight board, looks nice. I tried to change the icao names to full names (depicao to depname).

But after this the board didn´t show something in this row. It´s possible to change to airport fullnames? And what should i change.

thx for help.

Andreas

Posted

Hi@all!

I like the Flight board, looks nice. I tried to change the icao names to full names (depicao to depname).

But after this the board didn´t show something in this row. It´s possible to change to airport fullnames? And what should i change.

thx for help.

Andreas

I'm sure it is possible, but I don't have anywhere near enough PHP knowledge to figure out how. I experimented today to see if I could figure it out, but no success. I'm sure someone who actually knows what they are doing, will provide an answer, soon.

Posted

I'm sure it is possible, but I don't have anywhere near enough PHP knowledge to figure out how. I experimented today to see if I could figure it out, but no success. I'm sure someone who actually knows what they are doing, will provide an answer, soon.

Hi Robin, thx for your reply! It´s no problem, i´ll wait for the right code. ;)

Andreas

  • Administrators
Posted

I am not sure what you are using for variables, but if you are basing it off of what I posted a while back you could do ->

$depname = OperationsData::RetrieveAirportInfo($flight->depicao);
$arrname = OperationsData::RetrieveAirportInfo($flight->arricao);

right before your table row within your foreach loop, then change your table cells to ->

<td>'.$depname->name.'</td><td>'.$arrname->name.'</td>

And it will display the name of the airport instead of the icao code.

Posted

I am not sure what you are using for variables, but if you are basing it off of what I posted a while back you could do ->

$depname = OperationsData::RetrieveAirportInfo($flight->depicao);
$arrname = OperationsData::RetrieveAirportInfo($flight->arricao);

right before your table row within your foreach loop, then change your table cells to ->

<td>'.$depname->name.'</td><td>'.$arrname->name.'</td>

And it will display the name of the airport instead of the icao code.

Thx Simpilot for code, i pasted in the template and the dep and arr. rows are empty. Maybe i´ve done a mistake.

Here is the full code with the changes.

$query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC";

$list = DB::get_results($query);

echo '<h3>Departures : '.date('d M Y H:i:s T ').' </h3>';

echo '<table width="100%" border="0" bordercolor="#ffffff" bgcolor="#393938"><colgroup>

<col width="40">

<col width="85">

<col width="120">

<col width="120">

<col width="100">

<col width="100">

<col width="130">

</colgroup>';

echo '<tr><td><font color="#fafaf6"><b>Code</b></font></td><td><font color="#fafaf6"><b>Flight Number</b></font></td>

<td><font color="#fafaf6"><b>Departure</b></font></td>

<td><font color="#fafaf6"><b>Arrival</b></font></td><td><font color="#fafaf6"><b>Departure Time</b></font></td>

<td><font color="#fafaf6"><b>Aircraft</b></font></td><td><font color="#fafaf6"><b>Status</b></font></td></tr>';

$count = 0;

$depname = OperationsData::RetrieveAirportInfo($flight->depicao);

$arrname = OperationsData::RetrieveAirportInfo($flight->arricao);

foreach($list as $flight) {

if(date('G:i') >= '23') {

$time = '0';

}

else {

$time = date('G:i');

}

if(($flight->deptime + 0) >= $time) {

if($count < 8) {

$aircraft = OperationsData::getAircraftInfo($flight->aircraft);

echo '<tr><td><font color="#ffff00">'.$flight->code.'</font></td>

<td><font color="#ffff00">'.$flight->flightnum.'</font></td><td><font color="#ffff00">'.$depname->name.'</font></td>

<td><font color="#ffff00">'.$arrname->name.'</font></td><td><font color="#ffff00">'.$flight->deptime.'</font></td>

<td><font color="#ffff00">'.$aircraft->name.'</font></td>';

echo '<td><font color="#ffff00">';

$minutes = explode(':', $flight->deptime);

if($minutes['0'] <= date('G')) {

if(($minutes['1'] - date('i')) <= 0) {

echo 'Departed';

}

elseif(($minutes['1'] - date('i')) <= 5 && ($minutes['1'] - date('i')) >= 5) {

echo 'Final Call';

}

elseif(($minutes['1'] - date('i')) >= 6 && ($minutes['1'] - date('i')) <= 20) {

echo 'Boarding';

}

else {

echo 'Scheduled Departure';

}

}

else {

echo 'Scheduled Departure';

}

echo '</td></tr>';

$count++;

}

}

}

echo '</table>';

:unsure:

Andreas

  • Administrators
Posted

You need to move the

$depname = OperationsData::RetrieveAirportInfo($flight->depicao);
$arrname = OperationsData::RetrieveAirportInfo($flight->arricao);

within the foreach loop

foreach($list as $flight) {
$depname = OperationsData::RetrieveAirportInfo($flight->depicao);
$arrname = OperationsData::RetrieveAirportInfo($flight->arricao);

There is no $flight variable available prior to that.

  • 3 weeks later...
Posted

well ok i figure it again my self now one more question

to get it working need to put times on my schedules ? i m always leaving blank because i didn't like to use specified times :P

Posted

Times are just a guideline. It won't function if you don't put the departure/arrival times in all of your schedules, as it pulls the flight info from the times depending on what time it is (local database time)

  • 2 weeks later...
Posted

yeah that pastebin gives an invalid paste id now. I'm guessing I got in on this one too late. I have the table on my site but I dont belive mine says departing, landing or what ever it was that got listed before. that is slick to say the least. Mine just says arriving shortly, and in flight I believe. Mine is the basic plane jane version of the table that was released. ;) never altered it at all.

Posted

Hello guys,

I have a question. I have copy an edit the code a little bit. Now I have the problem, that all flight statuts will show next to each user.

What I Mean you can see here

test_pic.JPG

How I can change this? The code is following

<?php 
       date_default_timezone_set('USA/Atlanta');
       $query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC";
       $list = DB::get_results($query);
       echo '<h3>Expected Departures - Current Time is '.date('D M j H:i:s T Y').'</h3>';
echo '<table width="90%" border="1">'; 
echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Departure Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; 
$count = 0; 
foreach($list as $flight) 
{ 
       if(date('G:i') >= '23') 
       {$time = '0';} 
       else 
       {$time = date('G:i');} 
               if(($flight->deptime + 0) > $time) 
               { 
       if($count < 10) 
       { 
               $aircraft = OperationsData::getAircraftInfo($flight->aircraft); 
               echo '<tr><td>'.$flight->code.$flight->flightnum.'</td><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->deptime.'</td><td>'.$aircraft->fullname.'</td>'; 
               echo '<td>'; 
               if(($flight->deptime - date('G:i')) <= 2 / 120 * 1) 
               { 
               echo 'Departed'; 
               } 				

               if(($flight->deptime - date('G:i')) <= 2 / 120 * 5) 
               { 
               echo 'Gate closed'; 
               } 				

               if(($flight->deptime - date('G:i')) <= 2 / 120 * 15) 
               { 
               echo 'Final Call'; 
               } 

               if(($flight->deptime - date('G:i')) <= 2 / 120 * 30) 
               { 
               echo 'Boarding'; 
               } 

               if(($flight->deptime - date('G:i')) <= 2) 
               { 
               echo 'Check-In open'; 
               } 

  else
               { 
               echo ''; 
               } 
               echo '</td></tr>'; 
               $count++; 
       } 
       } 
} 
echo '</table>';

echo '<h3>Expected Arrivals - Current Time is '.date('G:i').'</h3>'; 
echo '<table width="90%" border="1">'; 
echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Arrival Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; 
$count = 0; 
foreach($list as $flight) 
{ 
       if(date('G:i') >= '23') 
       {$time = '0';} 
       else 
       {$time = date('G:i');} 
               if(($flight->arrtime + 0) > $time) 
               { 
       if($count < 10) 
       { 
               $aircraft = OperationsData::getAircraftInfo($flight->aircraft); 
               echo '<tr><td>'.$flight->code.$flight->flightnum.'</td><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 / 60 * 1) 
               { 
               echo 'Landed'; 
               }

               if(($flight->arrtime - date('G:i')) <= 1 / 60 * 15) 
               { 
               echo 'On Approach'; 
               } 
               else 
               { 
               echo 'On Time'; 
               } 
               echo '</td></tr>'; 
               $count++; 
       } 
       } 
} 
echo '</table>';  
?>

Who can help me please?

Regards

Olaf

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...