Jump to content

maverickalex

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maverickalex's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, i am running a php based virtual airline for a flightsimulator (free and open source) www.flightgear.org i am interested in creating a page where i can have members connect to the sim via localhost and port which will then read data sent from the sims internal server. i can send data via tcp by creating the port via the simulator I can create a protocol file so the server knows what data i am requesting (in the image above there is a protocol file "squawk" already requested. i know i can use fsocket_create etc or thats the theory. The socket would need to remain open from start to finish as data would be constantly changing. Any pointers would be appreciated. Thanks Alex
  2. phpvms.net everything you need
  3. Does this code appear to be correct in relation to the above advice? if(($flight->deptime - date('G:i')) <= 0.25) { echo 'Final Call'; } if(($flight->deptime - date('G:i')) >= 0.25 && $flight->deptime - date('G:i') <=1) { echo 'Proceed to Gate'; } if(($flight->deptime - date('G:i')) >= 1) { echo 'Scheduled to Depart On time'; }
  4. so what the code should be should be if(($flight->deptime - date('G:i')) <=0.25) is that correct?
  5. Could you give an example so i can get my head around it? Thanks for taking the time.
  6. Thanks, The actual time side of things works fine. Its trying to display anything in the status field of the table which has a value in between 1 hour and o minutes. If you look at the code, i have split 1 hour into minutes by 1/60 *15 (for 15minutes). I have used the <= to display less than 1 hour, im sure i need a >= somewhere and/or properly coding the "if" function. You can view the table on the dev site front page here as it is, www.atlasvirtualairlines.com/dev/index.php
  7. Hi all, I am trying to create a "Flights Display Table" which grabs schedules from a database. I am trying to add some time dependant strings. So that when a schedule reaches the one hour to go time the string reads "proceed to gate" when less that 15 minute string says "final call". Same sort of thing for arrival statistics. I have the table displaying and i can get "proceed to gate" and "scheduled departure" to show. heres my code so far, im just struggling to get the right code to show the "Final Call" and any in between strings. $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">'; 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); echo '<tr><td>'.$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')) <= 1 / 60 * 15) { echo 'Final Call'; } if(($flight->deptime - date('G:i')) <= 1) { echo 'Proceed to Gate'; } 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">'; 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); echo '<tr><td>'.$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>'; Any help would be appreciated Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.