Jump to content

Recommended Posts

Posted

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

  • Administrators
Posted

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

  • 3 weeks later...
Posted

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>

  • Administrators
Posted

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>

  • Administrators
Posted

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?

  • Administrators
Posted

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

Posted

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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...