Jump to content

Get Latest Flight Number for Pilot [SOLVED]


Stealthbird97

Recommended Posts

  • Moderators

PIREPS are stored in a table called phpvms_pireps, so in order to pull the data from that table you will need to follow the instruction below:

1. Create a file and name it as: PIREP.class.php

2. Inside that file write a function to pull the data out.

3. Create a TPL file and name it anything you want.

4. inside the TPL create a table and show the data.

Link to comment
Share on other sites

PIREPS are stored in a table called phpvms_pireps, so in order to pull the data from that table you will need to follow the instruction below:

1. Create a file and name it as: PIREP.class.php

2. Inside that file write a function to pull the data out.

3. Create a TPL file and name it anything you want.

4. inside the TPL create a table and show the data.

Parkho,

I'm can't write in php, neither can I understand the documentation given about the coding behind phpVMS.

Many airlines have done it so it must be easier than that, All I need is the Flight Number of the last flight the pilot flew.

54286795.png

Link to comment
Share on other sites

If you want it to work on the Public Profile Use this

Add this on top of (pilot_public_profile.tpl)

<?php
	 $last_location = PIREPData::getLastReports($userinfo->pilotid, 1, PIREP_ACCEPTED);
	 $airport_info = OperationsData::GetAirportInfo($location);
	 $airportname = $airport_info->name;
	 $report = PIREPData::GetLastReports($pilot->pilotid, 1);
?>

<li><strong>Last Flight: </strong><?php echo $last_location->code . $last_location->flightnum; ?>(<?php echo $last_location->submitdate; ?>)</li>

Remove if you don't want submit time and date

(<?php echo $last_location->submitdate; ?>)

Link to comment
Share on other sites

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...