Jump to content

Recommended Posts

Posted (edited)

Hello there,
This code shows the pilot's latest flights. But I have a problem and gives fatal error to the person who has no flight. How do I fix this.

Example;

 

<?php PIREPS::publicroutesmap($userinfo->pilotid,10)?>
 public function publicroutesmap($pilotID,$limit='')
   {


       $this->title = 'Flight Map of'.$pilotID;

       $pireps = PIREPData::findPIREPS(array('p.pilotid' => $pilotID),$limit);

       if(!$pireps)
       {
           $this->set('message', 'There are no PIREPs for this pilot!!');
           $this->render('core_error.tpl');
           return;
       }

       $this->set('allschedules', $pireps);
       $this->show('flown_routes_map.php');
   }

qPd7wS.png

uZLkER.png

Edited by GKT001
  • 1 month later...

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