jefry352 Posted July 3, 2012 Report Share Posted July 3, 2012 Hi y'all!!! I want to show on my Pilots list table a field called Location, but the current one, that means, if a Pilot flew from, for example, KMIA - KFLL, the current location changes to KFLL and the schedule system only will shows the schedules from KFLL. I wanted to use the PIREPData::getLastReports() function but it gives me this error, Catchable fatal error: Object of class stdClass could not be converted to string in C:\wamp\www\AER\lib\skins\bluelight\pilot_public_profile.tpl on line 37 By the way, I'm using Wamp as my Localhost server, this is the content of my file, <?php if(!$userinfo) { echo '<h3>Este Piloto no existe!</h3>'; return; } ?> <h3>Perfil de <?php echo $userinfo->firstname . ' ' . $userinfo->lastname?></h3> <table> <tr> <td align="center" valign="top"> <?php if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png')) { echo 'No avatar'; } else { echo '<img src="'.SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png'.'" alt="No Avatar" /> '; } ?> <br /><br /> <img src="<?php echo $userinfo->rankimage?>" alt="" /> </td> <td valign="top"> <ul> <li><strong>ID: </strong><?php echo $pilotcode ?></li> <li><strong>Rango: </strong><?php echo $userinfo->rank;?></li> <li><strong>Vuelos Totales: </strong><?php echo $userinfo->totalflights?></li> <li><strong>Horas Totales: </strong><?php echo Util::AddTime($userinfo->totalhours, $userinfo->transferhours); ?></li> <li><strong>Ubicación: </strong> <img src="<?php echo Countries::getCountryImage($userinfo->location);?>" alt="<?php echo Countries::getCountryName($userinfo->location);?>" /> <?php echo Countries::getCountryName($userinfo->location);?> </li> <li><strong>Posición actual</strong> <?php echo PIREPData::getLastReports(substr($pilotcode,-4), 1, PIREP_ACCEPTED) ?></li> <?php // Show the public fields if($allfields) { foreach($allfields as $field) { echo "<li><strong>$field->title: </strong>$field->value</li>"; } } ?> </ul> <p> <strong>Awards</strong> <?php if(is_array($allawards)) { ?> <ul> <?php foreach($allawards as $award) { /* To show the image: <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /> */ ?> <li><?php echo $award->name ?></li> <?php } ?> </ul> <?php } ?> </p> </td> </tr> </table> <?php Quote Link to comment Share on other sites More sharing options...
mseiwald Posted July 3, 2012 Report Share Posted July 3, 2012 <?php $last_location = PIREPData::getLastReports($userinfo->pilotid, 1, PIREP_ACCEPTED); echo "<strong>Your current Location:</strong> {$last_location->arricao}"; ?> this should give you the pilot`s actual location Quote Link to comment Share on other sites More sharing options...
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.