Pilots last location not working?

Hi guys,

i have implemented in our website couple of weeks ago that in the public and private profile your current location is shown.

<?php
			$lastreport = PIREPData::GetLastReports($userinfo, 1);

if(!$lastreport)
{
    $location = $userinfo->hub;
}
else
{
    $location = $lastreport->arricao;
}

?>
<?php
$airport_info = OperationsData::GetAirportInfo($location);

  $airportname = $airport_info->name;
?>

<li><strong>Pilot Current Location: </strong><?php echo $location; ?> - <?php echo $airportname; ?></li>

Now i figured out that all pilots have the same location displayed.

Can anybody help me with the issue resolving.

Thanks alot,

Markus

I think that is what you need!?

i changed it to what is below and it seemed to have worked..for the pilot profile page.

<?php

$lastreport = PIREPData::getLastReports($userinfo->pilotid, 1, PIREP_ACCEPTED);;

if(!$lastreport)

{

    $location = $userinfo->hub;

}

else

{

    $location = $lastreport->arricao;

}

?>

<?php

$airport_info = OperationsData::GetAirportInfo($location);

  $airportname = $airport_info->name;

?>

<li><strong>Current Location: </strong><?php echo $location; ?> - <?php echo $airportname; ?></li>

Thanks a lot, that worked now!