CrashGordon Posted May 28, 2010 Author Report Posted May 28, 2010 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. Just eye candy based on your schedule. Quote
CPC900 Posted May 28, 2010 Report Posted May 28, 2010 Awesome...now how do I change it so I get 10 returns instead of 5? Sorry if this was already asked. Quote
CrashGordon Posted May 29, 2010 Author Report Posted May 29, 2010 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) Quote
CPC900 Posted May 29, 2010 Report Posted May 29, 2010 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 Quote
CPC900 Posted May 29, 2010 Report Posted May 29, 2010 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?! Quote
Administrators simpilot Posted May 29, 2010 Administrators Report Posted May 29, 2010 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. Quote
CPC900 Posted May 29, 2010 Report Posted May 29, 2010 But it seems correct. The query came back "Sat May 29 09:29:38 2010"(which is correct) on the server dns results?! Quote
CrashGordon Posted May 29, 2010 Author Report Posted May 29, 2010 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. Quote
CPC900 Posted May 29, 2010 Report Posted May 29, 2010 Ye, it seems the issue is around midnight, I guess. Everything looks good mid day. Quote
CrashGordon Posted May 29, 2010 Author Report Posted May 29, 2010 Here is what happens when we get to 23:00. The flights are still displayed, but any flight that has a departure time prior to 00:00, displays no time data. Quote
CPC900 Posted May 30, 2010 Report Posted May 30, 2010 Disregard, I have to look into this further, and I am getting sleepy. Quote
Alex Posted May 31, 2010 Report Posted May 31, 2010 i seem to be able to even get delayed flights for some reason?? check the top and bottom rows!! Quote
Andy Posted June 13, 2010 Report Posted June 13, 2010 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 Quote
CrashGordon Posted June 14, 2010 Author Report Posted June 14, 2010 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. Quote
Andy Posted June 14, 2010 Report Posted June 14, 2010 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 Quote
Administrators simpilot Posted June 15, 2010 Administrators Report Posted June 15, 2010 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. Quote
Andy Posted June 16, 2010 Report Posted June 16, 2010 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>'; Andreas Quote
Administrators simpilot Posted June 16, 2010 Administrators Report Posted June 16, 2010 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. Quote
Andy Posted June 16, 2010 Report Posted June 16, 2010 thx! Now it will show the airportname in the table. Thanks a lot! Andreas Quote
dimitris Posted July 4, 2010 Report Posted July 4, 2010 can please someone post again the correct code to show departure and arrivals ? i lost it Quote
dimitris Posted July 4, 2010 Report Posted July 4, 2010 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 Quote
Jeff Posted July 4, 2010 Report Posted July 4, 2010 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) Quote
Gabriel Fernandez Posted July 17, 2010 Report Posted July 17, 2010 i get this error Warning: Invalid argument supplied for foreach() in /home/vhosts/voeaguia.coolpage.biz/core/templates/frontpage_main.tpl on line 64 The Line is: foreach($list as $flight) { Wait a reply Thanks Quote
TAV1702 Posted July 18, 2010 Report Posted July 18, 2010 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. Quote
airberlin virtual Posted July 19, 2010 Report Posted July 19, 2010 Hello everyone, does anyone still have the working code ? the pastebin has expired or has been deleted Quote
Airport Posted July 20, 2010 Report Posted July 20, 2010 Hello, that isnt normal:!? http://flygermany-va.de/index.php/ Martin Quote
Jeff Posted July 20, 2010 Report Posted July 20, 2010 It looks okay to me. As soon as you have some schedules added, they will start to appear there. Quote
Airport Posted July 21, 2010 Report Posted July 21, 2010 Ok, than it isnt normal: I have more then 20 schedules in database Anyone who can post the complete working code out there? Martin Quote
Jeff Posted July 21, 2010 Report Posted July 21, 2010 Ray, can you post your code in here? I seem to have messed something up here. Quote
Malchor Posted July 25, 2010 Report Posted July 25, 2010 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 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 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.