RogerB Posted February 5, 2011 Report Posted February 5, 2011 Got it to show, but now its old flights. I want live. I had the database prefixes wrong. Quote
Wingthor Posted February 5, 2011 Report Posted February 5, 2011 Got it to show, but now its old flights. I want live. I had the database prefixes wrong. I might talk over my head now, but you can try to change the "from" clause in the SQL you are using to acarsdata. SELECT * FROM acarsdata ORDER BY deptime + 0 ASC And see if you get any... Perhaps also after $list = DB::get_results($query); if (empty($list)) { echo "No one is flying to day"; exit; } But you are on your own here... Quote
RogerB Posted February 6, 2011 Report Posted February 6, 2011 What I don't understand is why people are pulling data from the schedules table in the first place. This isn't making sense, it doesn't seem to update correctly. Why wouldn't you pull it from the acarsdata table?? I tried all day and its obvious that i suck at php...... Quote
Wingthor Posted February 6, 2011 Report Posted February 6, 2011 What I don't understand is why people are pulling data from the schedules table in the first place. This isn't making sense, it doesn't seem to update correctly. Why wouldn't you pull it from the acarsdata table?? I tried all day and its obvious that i suck at php...... Don't know, guess they want to see upcoming flights? I would choose from both, and perhaps even bids. Did it work? Quote
Administrators simpilot Posted February 6, 2011 Administrators Report Posted February 6, 2011 I think this thread has gotten combined together with a thread looking for a board that shows live flights, which would come from the acars data table. This was originally a request to have a table that would display upcoming arrivals and departures fromt he schedules database. Quote
Jeff Posted March 21, 2011 Report Posted March 21, 2011 The php.ini file is usually located in the root folder, at least mine is . I cannot seem to find this php.ini file. Does anyone know the exact location of this file? Quote
Edwin Posted March 12, 2012 Report Posted March 12, 2012 I bumped into this thread via google and added it. I also have the time issue and although i found my php.ini and have set the timezone to Europe/Amsterdam it still goes 2 hours ahead, while my server is in the correct timezone. Any clues on this? Quote
mattsmith Posted April 12, 2012 Report Posted April 12, 2012 Depending on what setup your host has, try going to your control panel. Look for something that says PHP Configuration. Select central php.ini to be placed in your root directory. Activate those settings. You may find the file is named php.ini.default. Edit the file by finding the time zone setting and change it to Zulu. Save the file and rename it to php.ini. Your system will then be on UTC. I am using Fivedev but still can't find the php.ini Quote
michael Kraan Posted April 12, 2012 Report Posted April 12, 2012 Do your flights have the departure and arrival fields filled? Have you changed the prefix for your database from the standard "phpvms_"? Try a print_r using the $list variable and see what, if anything at all is coming back. New Code -> http://forum.phpvms....dpost__p__19704 Hi! there is no code more, can you send it to my or? Greets Michael kraan Quote
mattsmith Posted November 15, 2012 Report Posted November 15, 2012 Got it working to show CEST instead of EDT!! Without going into the php.ini. It iis also showing the correct time for my timezone. <?php date_default_timezone_set('Europe/Berlin'); $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>'; Hope this helps peeps. THANKS!!! Quote
mattsmith Posted December 3, 2012 Report Posted December 3, 2012 This is the code i'm using but nothing is showing in the status fro arrivals???? <?php date_default_timezone_set('europe/london'); $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 * 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 Time'; } echo '</td></tr>'; $count++; } } } echo '</table>'; ?> Quote
HighFlyerPL185 Posted January 29, 2013 Report Posted January 29, 2013 How do I add to this so it only displays flights that fly on the day? Also, my statuses weirdly are not working. It just always says 'On Time' for Arrivals or 'Departed' as Departures. if(($flight->arrtime - date('G:i')) >= 1 / 60 * 1) { echo 'Landed'; } elseif(($flight->arrtime - date('G:i')) >= 1 / 60 * 10) { echo 'Landing'; } elseif(($flight->arrtime - date('G:i')) <= 10) { echo 'On Time'; } if(($flight->deptime - date('G:i')) <= 1 / 60 * 1) { echo 'Departed'; } elseif(($flight->deptime - date('G:i')) <= 1 / 60 * 10) { echo 'Final Call'; } elseif(($flight->deptime - date('G:i')) <= 1 / 60 * 25) { echo 'Boarding'; } elseif(($flight->deptime - date('G:i')) <= 2) { echo 'Check In Open'; } else { echo 'Scheduled Departure'; } Quote
ARV187 Posted February 11, 2013 Report Posted February 11, 2013 Hi, i dont understand the install instrucctions, Can someone help me please? I make a .txt, paste the code and after change de .txt extension by .php extension, after i copy the code in a new page, in phpvms, and up the file .php that i did in hosting, but i have a error. http://www.argavirtual.xtrweb.com/core/modules/Schedules/Schedules%20board.php Fatal error: Class 'DB' not found in /home/u131375289/public_html/core/modules/Schedules/Schedules board.php on line 3 <?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>'; ?> Quote
Moderators Parkho Posted February 27, 2013 Moderators Report Posted February 27, 2013 Here is how it works my way: 1. Create a class file like GetSchedules.class.php and paste the following in there and save it. Then upload into your core/common folder: <?php class GetSchedules extends CodonData { publicfunction getscheds() { $sql = SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; return DB::get_results($sql); } } ?> 2. Use a table where you want to show the pulled out data like this: <?php $list = GetSchedules::getscheds(); ?> Upcoming Arrivals - Current Time is <?php echo date('G:i') ;?></h3> <table width="100%" border="1"> <tr> <td>Departure</td> <td>Arrival</td> <td>Arrival Time</td> <td>Aircraft</td> <td>Status</td> </tr> <?php $count = 0; foreach($list as $flight) { if(($flight->arrtime + 0) > date('G:i')) { if($count < 5) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); ?> <tr> <td><?php echo $flight->depicao ;?></td> <td><?php echo $flight->arricao ;?></td> <td><?php echo $flight->arrtime ;?></td> <td><?php echo $aircraft->fullname ;?></td> </tr> <tr> <td> <?php if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'In Flight'; } $count++; ?> </td> </tr> } } } </table> Quote
ARV187 Posted February 28, 2013 Report Posted February 28, 2013 Here is how it works my way: 1. Create a class file like GetSchedules.class.php and paste the following in there and save it. Then upload into your core/common folder: <?php class GetSchedules extends CodonData { publicfunction getscheds() { $sql = SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; return DB::get_results($sql); } } ?> 2. Use a table where you want to show the pulled out data like this: <?php $list = GetSchedules::getscheds(); ?> Upcoming Arrivals - Current Time is <?php echo date('G:i') ;?></h3> <table width="100%" border="1"> <tr> <td>Departure</td> <td>Arrival</td> <td>Arrival Time</td> <td>Aircraft</td> <td>Status</td> </tr> <?php $count = 0; foreach($list as $flight) { if(($flight->arrtime + 0) > date('G:i')) { if($count < 5) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); ?> <tr> <td><?php echo $flight->depicao ;?></td> <td><?php echo $flight->arricao ;?></td> <td><?php echo $flight->arrtime ;?></td> <td><?php echo $aircraft->fullname ;?></td> </tr> <tr> <td> <?php if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'In Flight'; } $count++; ?> </td> </tr> } } } </table> Hi Parkho, I did that, created with notepad of windows with the first code, and after rename it as "GetSchedules.class.php" (extension included), after i uploaded to core/common folder via ftp. The table was created in admin options "Add new page". i think i did something wrong. this is the result: http://www.argavirtual.xtrweb.com/pruebas/index.php/pages/schedules2 Quote
Moderators Parkho Posted February 28, 2013 Moderators Report Posted February 28, 2013 Small modification: <?php class GetSchedules extends CodonData { public function getscheds() { $sql = "SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; return DB::get_results($sql); } } ?> The .tpl: <?php $list = GetSchedules::getscheds(); ?> Upcoming Arrivals - Current Time is <?php echo date('G:i') ;?></h3> <table width="100%" border="1"> <tr> <td>Departure</td> <td>Arrival</td> <td>Arrival Time</td> <td>Aircraft</td> <td>Status</td> </tr> <?php $count = 0; foreach($list as $flight) { if(($flight->arrtime + 0) > date('G:i')) { if($count < 5) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); ?> <tr> <td><?php echo $flight->depicao ;?></td> <td><?php echo $flight->arricao ;?></td> <td><?php echo $flight->arrtime ;?></td> <td><?php echo $aircraft->fullname ;?></td> <td> <?php if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'In Flight'; } $count++; ?> </td> </tr> <?php } } } ?> </table> Screen Shot: Quote
Tato123 Posted December 30, 2015 Report Posted December 30, 2015 Hi, i'have a problem with the order my code public static function getscheddep() { $sql = "SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; return DB::get_results($sql); } The system order only the hours and not the minute. Any suggestion? Thanks and happy new year at all Quote
Industrialshadow Posted August 22, 2016 Report Posted August 22, 2016 Hello i have includet this on my Index. But i have the Problem i dont see the Departure and Arrival Airports. I use this script <!-- Begin Company News --> <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout-wrapper layout-item-0"> <div class="art-content-layout layout-item-1"> <div class="art-content-layout-row"> <div class="art-layout-cell layout-item-2" style="width: 100%" > <div class="art-blockheader"> <h3 class="t">Departure/Arrival Board</h3> </div> <div align="center"> <table align="center" width="100%" border="0"> <tr> <td><?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 align="center" width="90%" border="0" bgcolor="#99FF00" >'; # 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); $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 align="center" width="90%" border="1" bgcolor="#99FF00" >'; # 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); $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.',+'; } ?></td> </tr> </table> <div align="center"> <!-- End Company News --> SO have anybody a idea to solve this Problem? Cheers Quote
Industrialshadow Posted September 6, 2016 Report Posted September 6, 2016 have no guy a solution for my post above? I tried this many Time but i dont find a way to display the dep/arr ICAO Quote
Members Vangelis Posted September 13, 2016 Members Report Posted September 13, 2016 Try this Code <!-- Begin Company News --> <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout-wrapper layout-item-0"> <div class="art-content-layout layout-item-1"> <div class="art-content-layout-row"> <div class="art-layout-cell layout-item-2" style="width: 100%" > <div class="art-blockheader"> <h3 class="t">Departure/Arrival Board</h3> </div> <div align="center"> <table align="center" width="100%" border="0"> <tr> <td><?php # # $query = "SELECT * FROM phpvmsSIM_schedules ORDER BY deptime + 0 ASC"; # $list = DB::get_results($query); # echo '<h3>Expected Departures - Current Time is '.date('G:i').'</h3>'; # echo '<table align="center" width="90%" border="0" bgcolor="#99FF00" >'; # 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); $depname = OperationsData::getAirportInfo($flight->depicao); $arrname = OperationsData::getAirportInfo($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 align="center" width="90%" border="1" bgcolor="#99FF00" >'; # 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); $depname = OperationsData::getAirportInfo($flight->depicao); $arrname = OperationsData::getAirportInfo($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.',+'; } ?></td> </tr> </table> <div align="center"> <!-- End Company News --> 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.