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
nabeel
October 3, 2009, 12:47pm
2
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
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>
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>
I only have one online flight displaying,
how to i make two or more display?
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?
nabeel
October 23, 2009, 1:46pm
8
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
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)
nabeel
October 23, 2009, 10:15pm
10
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.
Can someone give me a code example?
I was really confused on the links you gave me (sorry, im pretty new to php)
nabeel
October 24, 2009, 12:08am
12
The code simpilot posted before in this thread is it
Just left out the { and } and didn’t notice.
Will report back when two people at once are doing a flight.
nabeel
October 24, 2009, 4:04am
14
Well, if there’s one person, it’ll still output correctly. It’ll return that same format in either way (an array)