Jeff Posted July 25, 2010 Report Share Posted July 25, 2010 You have too many departure calls (5) I believe it can only have 3. Try removing some. CheckIn Open, and Gate Closed Quote Link to comment Share on other sites More sharing options...
Malchor Posted July 26, 2010 Report Share Posted July 26, 2010 I has done it but nothing change! Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted July 26, 2010 Report Share Posted July 26, 2010 Ray, can you post your code in here? I seem to have messed something up here. Sorry I missed this post. Do you still need the code? Quote Link to comment Share on other sites More sharing options...
Malchor Posted July 27, 2010 Report Share Posted July 27, 2010 Yes Sir Please! Quote Link to comment Share on other sites More sharing options...
Jeff Posted July 27, 2010 Report Share Posted July 27, 2010 yeah Ray, can you paste the whole departure/arrival code, something went terribly wrong with mine and I couldn't get it fixed. Quote Link to comment Share on other sites More sharing options...
airberlin virtual Posted July 28, 2010 Report Share Posted July 28, 2010 yeah Ray, can you paste the whole departure/arrival code, something went terribly wrong with mine and I couldn't get it fixed. Could we get a copy as well? Quote Link to comment Share on other sites More sharing options...
Malchor Posted July 29, 2010 Report Share Posted July 29, 2010 CHRIS I WOULD GIVE YOU IF i GOT IT Olaf Quote Link to comment Share on other sites More sharing options...
Malchor Posted August 2, 2010 Report Share Posted August 2, 2010 TAV1702 can you send us the code again? Quote Link to comment Share on other sites More sharing options...
Alex Posted August 4, 2010 Report Share Posted August 4, 2010 here is the flight board i'm using.I am using obsessblue skin, you may need to add the font colour to you stylesheet.css in this example. the code in frontpage.tpl placed where you want the table to show. <?php # # $query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC"; # $list = DB::get_results($query); # echo '<h3>Expected Departures - Current Time is '.date('G:i').'</h3>'; # echo '<table width="90%" border="1" bgcolor="#030A0A" >'; # 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 < 5) { # $aircraft = OperationsData::getAircraftInfo($flight->aircraft); $depname = OperationsData::RetrieveAirportInfo($flight->depicao); $arrname = OperationsData::RetrieveAirportInfo($flight->arricao); # echo '<tr><td>'.$flight->flightnum.'</td><td>'.$depname->name.'</td><td>'.$arrname->name.'</td><td>'.$flight->deptime.'</td><td>'.$aircraft->fullname.'</td>'; # echo '<td>'; # $minutes = explode(':', $flight->deptime); # if($minutes['0'] <= date('G')) { # if(($minutes['1'] - date('i')) <= 0) { # echo 'Departed'; # } # elseif(($minutes['1'] - date('i')) <= 15 && ($minutes['1'] - date('i')) >= 1) { # echo 'Final Call'; # } # elseif(($minutes['1'] - date('i')) >= 30 && ($minutes['1'] - date('i')) <= 20) { # echo 'Proceed to Gate'; # } # else { # echo 'Scheduled Departure'; # } # } # else { # echo 'Scheduled Departure'; # } # echo '</td></tr>'; # $count++; # } # } # } # echo '</table>'; # # echo '<h3>Expected Arrivals - Current Time is '.date('G:i').'</h3>'; # echo '<table width="90%" border="1" bgcolor="#030A0A" >'; # 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 < 5) { # $aircraft = OperationsData::getAircraftInfo($flight->aircraft); $depname = OperationsData::RetrieveAirportInfo($flight->depicao); $arrname = OperationsData::RetrieveAirportInfo($flight->arricao); # echo '<tr><td>'.$flight->flightnum.'</td><td>'.$depname->name.'</td><td>'.$arrname->name.'</td><td>'.$flight->arrtime.'</td><td>'.$aircraft->fullname.'</td>'; # echo '<td>'; # $minutes2 = explode(':', $flight->arrtime); # if($minutes2['0'] <= date('G')) { # if($minutes2['1'] - (date('i')) >= 30) { # echo 'On Time'; # } # elseif(($minutes2['1'] - date('i')) >= 1 && ($minutes2['1'] - date('i')) <= 30) { # echo 'On Approach'; # } # else { # echo 'Landed'; # } # # } # else { # echo 'On Time'; # } # echo '</td></tr>'; # $count++; # } # } # } # echo '</table>'; $flights = PIREPData::getRecentReportsByCount(10); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> the text color change in stylesheet.css .mc020301 { font-size: 12px; color: #FFC600; line-height: 18px; letter-spacing: -0.1px; width: 700px; ideally i always set up a duplicate site for development purposes. Quote Link to comment Share on other sites More sharing options...
Malchor Posted August 9, 2010 Report Share Posted August 9, 2010 If I copy your code, my Dep Airport and Arr Airport Field dont show anything. Quote Link to comment Share on other sites More sharing options...
El Macara Posted September 19, 2010 Report Share Posted September 19, 2010 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. please someone help me, I put the same code in my virtual airline, and now I have problem with the area of the map, the map can not see anything. remove the code again but the problem persists. can someone please help me solve this problem? Quote Link to comment Share on other sites More sharing options...
shiljo Posted October 28, 2010 Report Share Posted October 28, 2010 I cant get this right, allways having this warnings... Warning: Invalid argument supplied for foreach() in /home/croatia/public_html/russian/lib/skins/ObsessBlue/frontpage_main.tpl on line 68 Warning: Invalid argument supplied for foreach() in /home/croatia/public_html/russian/lib/skins/ObsessBlue/frontpage_main.tpl on line 106 Template iz in skin folder, is that have something to do because of dbase? Thank you Quote Link to comment Share on other sites More sharing options...
MANFahrer Posted October 31, 2010 Report Share Posted October 31, 2010 Hallo ich möchte das bei uns auf der Webseite auch darstellen aber wenn ich den Code in die Front_main.tpl speichere dann erscheint nix und wenn ich das php am Anfang weglasse dann werden die Variablen nicht aufgelöst. Kann mir jemand eine Anleitung geben wie ich das einfüge? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Hi I want to represent us on your website but when I save the code in the Front_main.tpl appears then nothing and if I leave out the php to the beginning then the variables are not resolved. Can anyone give an explanation on how I add it? Quote Link to comment Share on other sites More sharing options...
terry Posted November 9, 2010 Report Share Posted November 9, 2010 Hi all, was hoping someone could post the latest code for the flightboard as the pastebin link from Simpilot is no longer available. I have tried to assemble the code myself but am failing. Thanks in advance Terry Quote Link to comment Share on other sites More sharing options...
petwouters Posted January 1, 2011 Report Share Posted January 1, 2011 Hi guys, Happy New Year! I have a question, I've been trying to add the flightboard and it is working partially. I have adjusted the code which can be found elsewhere in this topic to reflect our circumstances etc. but the flight board comes up with a few gaps. First, the code I used/altered <?php $h = "6";// Hour for time zone goes here e.g. +7 or -4, just remove the + or - $hm = $h * 60; $ms = $hm * 60; $gmdate = gmdate("H:i", time()+($ms)); # # $query = "SELECT * FROM phpvms_schedules WHERE deptime>='$gmdate' AND depicao='UAAA' ORDER BY deptime"; # $list = DB::get_results($query); # echo '<h1>Almaty Departures - Current time is '.$gmdate.'</h1>'; # echo '<table width="100%" border="1" bgcolor="#FFFFFF" >'; # echo '<tr><td><b>Flight Number</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 < 5) { # $aircraft = OperationsData::getAircraftInfo($flight->aircraft); $depname = OperationsData::RetrieveAirportInfo($flight->depicao); $arrname = OperationsData::RetrieveAirportInfo($flight->arricao); # echo '<tr><td>TZE'.$flight->flightnum.'</td><td>'.$arrname->name.'</td><td>'.$flight->deptime.'</td><td>'.$aircraft->fullname.'</td>'; # echo '<td>'; # $minutes = explode(':', $flight->deptime); # if($minutes['0'] <= date('G')) { # if(($minutes['1'] - date('i')) <= 0) { # echo 'Departed'; # } # elseif(($minutes['1'] - date('i')) <= 15 && ($minutes['1'] - date('i')) >= 1) { # echo 'Final Call'; # } # elseif(($minutes['1'] - date('i')) >= 30 && ($minutes['1'] - date('i')) <= 20) { # echo 'Proceed to Gate'; # } # else { # echo 'Scheduled Departure'; # } # } # else { # echo 'Scheduled Departure'; # } # echo '</td></tr>'; # $count++; # } # } # } # echo '</table>'; # # echo '<h1>Expected Arrivals - Current Time is '.date('G:i').'</h1>'; # echo '<table width="90%" border="1" bgcolor="#FFFFFF" >'; # 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 < 5) { # $aircraft = OperationsData::getAircraftInfo($flight->aircraft); $depname = OperationsData::RetrieveAirportInfo($flight->depicao); $arrname = OperationsData::RetrieveAirportInfo($flight->arricao); # echo '<tr><td>TZE'.$flight->flightnum.'</td><td>'.$depname->name.'</td><td>'.$arrname->name.'</td><td>'.$flight->arrtime.'</td><td>'.$aircraft->fullname.'</td>'; # echo '<td>'; # $minutes2 = explode(':', $flight->arrtime); # if($minutes2['0'] <= date('G')) { # if($minutes2['1'] - (date('i')) >= 30) { # echo 'On Time'; # } # elseif(($minutes2['1'] - date('i')) >= 1 && ($minutes2['1'] - date('i')) <= 30) { # echo 'On Approach'; # } # else { # echo 'Landed'; # } # # } # else { # echo 'On Time'; # } # echo '</td></tr>'; # $count++; # } # } # } # echo '</table>'; $flights = PIREPData::getRecentReportsByCount(10); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> Here's a screenshot of what I mean - Note the gap in the destination on the second or so line. Don't know how that happens? Maybe this has something to do with flights that don't happen each day? Also, the code suggests the status should receive updates from Scheduled Departure to Go To Gate etc. and that's not happening either. As I know pretty much not a great deal about PHP, could anyone please suggest any solutions? Many thanks Peter Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted January 2, 2011 Report Share Posted January 2, 2011 Sorry everyone. I forgot I posted in this thread. The code I am using is the code that Simpilot gave us all. The only thing I have changed is some css stuff. You will nee to find where I edited it and redo it to fit your site. Other then that, like I said it is IDENTICAL to what Simpilot released. I have not altered any php or sql. <?php $query = "SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; $list = DB::get_results($query); echo '<center><h3>Upcoming Arrivals - Current Time is '.date('G:i').'</h3></center>'; echo '<table width="98%" cellpadding="3" cellspacing="1" border="0">'; echo '<tr><th>Departure</th><th>Arrival</th><th>Arrival Time</th><th>Aircraft</th><th>Status</th></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><center>'.$flight->depicao.'</center></td><td><center>'.$flight->arricao.'</td></center><td><center>'.$flight->arrtime.'</td></center><td><center>'.$aircraft->fullname.'</td></center>'; echo '<td><center>'; if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'In Flight'; } echo '</td></center></tr>'; $count++; } } } echo '</table>'; ?> <br /> Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted January 2, 2011 Report Share Posted January 2, 2011 Sorry everyone. I forgot I posted in this thread. The code I am using is the code that Simpilot gave us all. The only thing I have changed is some css stuff. You will nee to find where I edited it and redo it to fit your site. Other then that, like I said it is IDENTICAL to what Simpilot released. I have not altered any php or sql. Er uhhhh I think it was Simpilot. If not I apologize to the Author. And please note that around midnight...ish, the table is going to go blank. If does not like to pull data from 23:00-24:00 or something like that. THe rest of the day it works great. <?php $query = "SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; $list = DB::get_results($query); echo '<center><h3>Upcoming Arrivals - Current Time is '.date('G:i').'</h3></center>'; echo '<table width="98%" cellpadding="3" cellspacing="1" border="0">'; echo '<tr><th>Departure</th><th>Arrival</th><th>Arrival Time</th><th>Aircraft</th><th>Status</th></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><center>'.$flight->depicao.'</center></td><td><center>'.$flight->arricao.'</td></center><td><center>'.$flight->arrtime.'</td></center><td><center>'.$aircraft->fullname.'</td></center>'; echo '<td><center>'; if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'In Flight'; } echo '</td></center></tr>'; $count++; } } } echo '</table>'; ?> <br /> Quote Link to comment Share on other sites More sharing options...
Thomas Rozanov Posted February 2, 2011 Report Share Posted February 2, 2011 I used simpilot's script and this is the error i get. Warning: Invalid argument supplied for foreach() in /home/brtvirtu/public_html/lib/skins/ObsessBlue/frontpage_main.tpl on line 18 And line 18 is : foreach($list as $flight) { Please Help Quote Link to comment Share on other sites More sharing options...
Thomas Rozanov Posted February 2, 2011 Report Share Posted February 2, 2011 I used simpilot's script and this is the error i get. Warning: Invalid argument supplied for foreach() in /home/brtvirtu/public_html/lib/skins/ObsessBlue/frontpage_main.tpl on line 18 And line 18 is : foreach($list as $flight) { Please Help Also How Do you change the time in the script? i want GMT +2 Quote Link to comment Share on other sites More sharing options...
Thomas Rozanov Posted February 3, 2011 Report Share Posted February 3, 2011 Please Help! I will be very thankful Quote Link to comment Share on other sites More sharing options...
RogerB Posted February 3, 2011 Report Share Posted February 3, 2011 yeah getting an error on line 21 also Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted February 3, 2011 Administrators Report Share Posted February 3, 2011 Do you guys have a different table prefix setup for your data base? If so, change it on the second line phpvms_schedules -to- yourprefix_schedules That error is saying there is no data coming back from the database. 1 Quote Link to comment Share on other sites More sharing options...
RogerB Posted February 3, 2011 Report Share Posted February 3, 2011 That did it! Thanks Quote Link to comment Share on other sites More sharing options...
RogerB Posted February 3, 2011 Report Share Posted February 3, 2011 how can we change the time zone? Its reading my server time, I want Alaskan. I looked it up on some php sites but it doesn't make sense to me. Quote Link to comment Share on other sites More sharing options...
Wingthor Posted February 4, 2011 Report Share Posted February 4, 2011 I am not sure if this would help, but in my phpvms DB the table for schedules is named schedules not phpvms_schedules, so check it out. Guess you get that error since array list$ is empty, due to the naming error of the table in the SQL. To get date converted. You seem to not need all the fields in the query, use rather this selec function: select id, depicao, arricao, date_format(convert_TZ(concat(curdate()," ", left(deptime,5)) , '+00:00','+2:00'),'%T') as 'deptime', date_format(convert_TZ(concat(curdate()," ", left(arrtime,5)), '+00:00','+2:00'),'%T') as 'arrtime', aircraft, daysofweek from schedules where instr(daysofweek,'6')>0 order by arrtime ASC Make a php variable which finds out which day of week it is, and convert to a value that fits in with the daysofweek field. <$php $curday=cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y")); ?> or something... and put $curday in to where clause rather than six. This query will select all flight for a saturday. To convert the time to local, change the timenumbera after the both '+' om the sql. The first is the time relative to GMT and second is your relative to GMT. I have not testet other than as pure SQL directly on the server. So test at own risk. Regards Quote Link to comment Share on other sites More sharing options...
Wingthor Posted February 4, 2011 Report Share Posted February 4, 2011 Or as an real board, you make two arrays, where you have one for arrivals and one for departures. Just add to the where clause after '6') to the where clause eg. Arrivals: AND depicao = 'EGGL' Departures: AND arricao = 'EGGL' Regards Quote Link to comment Share on other sites More sharing options...
RogerB Posted February 5, 2011 Report Share Posted February 5, 2011 This isn't showing on my site. Not sure why. Quote Link to comment Share on other sites More sharing options...
Wingthor Posted February 5, 2011 Report Share Posted February 5, 2011 This isn't showing on my site. Not sure why. Not sure what you mean, but there might an issue with the table prefix. Quote Link to comment Share on other sites More sharing options...
RogerB Posted February 5, 2011 Report Share Posted February 5, 2011 When I implement the code, nothing shows, I pretty much just want it to reflect the acars map. Live flights Quote Link to comment Share on other sites More sharing options...
Wingthor Posted February 5, 2011 Report Share Posted February 5, 2011 When I implement the code, nothing shows, I pretty much just want it to reflect the acars map. Live flights Ok, from my understanding of the thread, the data shows flights according to schedule. Not live flights. Maybe I am wrong Quote Link to comment Share on other sites More sharing options...
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.