AFVA | Mitchell Posted October 3, 2009 Report Share Posted October 3, 2009 I want to make a bar at the top of the page with the current flights online. Info I want with it: Dep Airport Arr Airport Status Pilot Name Flight Number phpVMS version 1.2.700 (will be updated in the next coming days) Thanks in advance, Mitchell Williamson Australian Frontier Virtual Airways Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted October 3, 2009 Administrators Report Share Posted October 3, 2009 You'll have to call: $pilots = ACARSData:GetACARSData(); And that'll be the list of pilots with all that information you need. See my signature for the link to the API docs Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted October 22, 2009 Author Report Share Posted October 22, 2009 I get the word 'array' How do i fix this? Code: <?php echo $pilots = ACARSData::GetACARSData($cutofftime = '720'); ?> <td> <?php echo $pilots->pilotname; ?> </td> <td> <?php echo $pilots->flightnum; ?> </td> <td> <?php echo $pilots->depicao; ?> </td> <td> <?php echo $pilots->arricao; ?> </td> <td> <?php echo $pilots->phasedetail; ?> </td> </tbody> Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 22, 2009 Administrators Report Share Posted October 22, 2009 You need to extract your data from the array with a foreach command. How about something like this... <table> <?php $data = (ACARSData::GetACARSData($cutofftime = '720')); foreach ($data as $pilots) { ?> <tr> <td> <?php echo "$pilots->firstname $pilots->lastname"; ?> </td> <td> <?php echo $pilots->flightnum; ?> </td> <td> <?php echo $pilots->depicao; ?> </td> <td> <?php echo $pilots->arricao; ?> </td> <td> <?php echo $pilots->phasedetail; ?> </td> </tr> <?php } ?> </table> Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted October 22, 2009 Administrators Report Share Posted October 22, 2009 Dave nailed it Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted October 23, 2009 Author Report Share Posted October 23, 2009 I only have one online flight displaying, how to i make two or more display? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted October 23, 2009 Administrators Report Share Posted October 23, 2009 I only have one online flight displaying, how to i make two or more display? It should be looping through all the data that is available- Is there more than one pilot using ACARS within the timeout period you are setting in the command? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted October 23, 2009 Administrators Report Share Posted October 23, 2009 The cutoff time is in minutes. If you don't enter a time, it takes the default you entered in the local.config.php In addition, you can just do: $data = ACARSData::GetACARSData(720); No need to include the variable with it Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted October 23, 2009 Author Report Share Posted October 23, 2009 Can someone explain in it, i am confused ??? It should be looping through all the data that is available- Is there more than one pilot using ACARS within the timeout period you are setting in the command? I want to make the online pilots appear in a list (table) Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted October 23, 2009 Administrators Report Share Posted October 23, 2009 The data is returned as an array: http://us.php.net/manual/en/language.types.array.php You need to use a loop like this: http://us.php.net/manual/en/control-structures.foreach.php simpilot put an example up there of exactly how it would work. Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted October 23, 2009 Author Report Share Posted October 23, 2009 Can someone give me a code example? I was really confused on the links you gave me (sorry, im pretty new to php) Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted October 24, 2009 Administrators Report Share Posted October 24, 2009 The code simpilot posted before in this thread is it Quote Link to comment Share on other sites More sharing options...
AFVA | Mitchell Posted October 24, 2009 Author Report Share Posted October 24, 2009 Just left out the { and } and didn't notice. Will report back when two people at once are doing a flight. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted October 24, 2009 Administrators Report Share Posted October 24, 2009 Well, if there's one person, it'll still output correctly. It'll return that same format in either way (an array) 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.