Recalling information ..

Nabeel,

I’ve tried looking and tried figuring out the API, tried reading PHP tutorials, to no avail.  I don’t have any idea how to simply pull a logged in user’s data onto a webpage. A simple “hello world” would help me.  The only thing I’ve been able to do is recall the pilot’s ID by putting:

<?php
$pilotid = PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid);
?>

in and then:

<li><b>Your Callsign</b>: <?php echo $pilotid ?></li>

I’m probably going about it all wrong but that works at least.  I’m trying to find a way to pull up the total number of hours, latest flight they flew in a short format (such as “Your last flight: TXA1441 - KAUS - KDEN”).

Thanks for the help

All of the logged in user’s info is under Auth::$userinfo

Do a print_r on it,

<?php
print_r(Auth::$userinfo);

echo Auth::$userinfo->firstname;
echo Auth::$userinfo->totalhours;
echo Auth::$userinfo->totalflights;
?>

There’s an API function for putting the latest pireps for a pilot. Your getpilotcode() code is correct