Stealthbird97 Posted November 18, 2012 Report Share Posted November 18, 2012 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. 1 Quote Link to comment Share on other sites More sharing options...
mattia Posted November 18, 2012 Report Share Posted November 18, 2012 You want see the DEP ICAO and ARR ICAO?? Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted November 18, 2012 Moderators Report Share Posted November 18, 2012 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. Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted November 18, 2012 Author Report Share Posted November 18, 2012 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. Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted November 18, 2012 Author Report Share Posted November 18, 2012 No Worries Found the Code on the last page of topics in Code Snippets <?php echo $report->code . $report->flightnum; ?> Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted November 18, 2012 Author Report Share Posted November 18, 2012 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; ?>) Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted November 18, 2012 Moderators Report Share Posted November 18, 2012 Sorry, I was writing in general. 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.