Jump to content

Recommended Posts

Posted

I want the pilots last filed flight to show up under a Heading.

What code do i need to get this.

I'm guessing ti will be something like this?

<?php echo $userinfo->lastpirep; ?><br />

Except that seems to get the Date and Time of the latest pirep filed by the pilot.

Thanks in Advance.

  • Like 1
  • Moderators
Posted

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.

Posted

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

Posted

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; ?>)

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