Pilot images do not appear on some pages [SOLVED]

First of all, I’m using Simpilot phpVMS 5.5 and Web541 CrewCenter and my language is Portuguese.

 

Error in: Dropdown

 

On some pages, or almost all, the photo of the pilot is not showing up. Appearing only on the panel.

 

When I go to the panel, the image appears correctly, but when I go to another page, the default phpVMS appears. Here is the image: In the dashboard: http://prntscr.com/gqgmvh || In the downloads: http://prntscr.com/gqgmp4

 

App_top code:

\<ul class="dropdown-menu"\> \<!-- User image --\> \<li class="user-header"\> \<img src="\<?php echo PilotData::getPilotAvatar($pilotcode); ?\>" class="img-circle" alt="User Image"\>

 

change this:

\<img src="\<?php echo PilotData::getPilotAvatar($pilotcode); ?\>" class="img-circle" alt="User Image"\>

to this:

\<?php $pilotcode = PilotData::getPilotCode(Auth::$userinfo-\>code, Auth::$userinfo-\>pilotid); ?\> \<img src="\<?php echo PilotData::getPilotAvatar($pilotcode); ?\>" class="img-circle" alt="User Image"\>

 

11 minutes ago, servetas said:

change this:

<img src=“<?php echo PilotData::getPilotAvatar($pilotcode); ?>” class=“img-circle” alt=“User Image”>

to this:

<?php $pilotcode = PilotData::getPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid); ?> <img src=“<?php echo PilotData::getPilotAvatar($pilotcode); ?>” class=“img-circle” alt=“User Image”>

 

OMG, Thank you!! Now you’re working right. (SOLVED)

Just to explain why it did not work. The “$pilotcode” variable is only populated in Profile. When you were visiting other pages, the “$pilotcode” variable had not been populated and considering that it was empty, no avatar was returned by the PilotData::getPilotAvatar($pilotcode) function. The line I added populates the “$pilotcode” variable based on the currently logged in pilot and that’s why it now works in every part of your website.