Dyl1103 Posted July 21, 2021 Report Posted July 21, 2021 Hello all! Having an issue where I'm trying to display a pilots current location based on their last PIREP, however on any page that calls for the location from their last PIREP, it still displays their hub. For example, on my profile page I'm using: <?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>Current Location: </strong><?php echo $location; ?> - <?php echo $airportname; ?></li> this is the output (still gotta tweak some styling): https://prnt.sc/1dxsxk4 I guess I know it's talking to the database, cause its displaying the proper hub per pilot...but I'm lost on it actually showing the location based on their last PIREP.... any thoughts? Quote
Moderators Parkho Posted July 22, 2021 Moderators Report Posted July 22, 2021 You're not getting the last report arricao. Try this: $userinfo= Auth::$userinfo->pilotid; Quote
Dyl1103 Posted July 22, 2021 Author Report Posted July 22, 2021 20 minutes ago, Parkho said: You're not getting the last report arricao. Try this: $userinfo= Auth::$userinfo->pilotid; I feel.....oh so stupid! Thank you! Worked like a charm. 1 Quote
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.