Jump to content

Recalling information ..


completelydeck

Recommended Posts

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

Link to comment
Share on other sites

  • Administrators

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

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