TB1 Posted March 2, 2014 Report Posted March 2, 2014 Hey guys, I am trying to design some code for the welcome back section on the Pacific skin so that it comes up with a pilot's booked flight if he has one. Currently I have got this far: <i STYLE="float:left;">Welcome back, <a href="<?php echo url('profile'); ?>" ><?php echo Auth::$userinfo->firstname . " " . Auth::$userinfo->lastname ;?></a>! <?php if($bid) { echo 'You have an upcoming flight: <?php echo $bid->code . $bid->flightnum; ?>'; } elseif(!$bid) { echo 'You have no upcoming flights.'; } ?></i> The problem is, the code is always saying 'You have no upcoming flights' even if there is one booked for that pilot. Anyone know what I need to do to get the bidded flight number to appear in place of the 'You have no upcoming flights' when there is one? Thanks! Quote
Tom Posted March 2, 2014 Report Posted March 2, 2014 Where are you assigning $bid? If it's never assigned it will always return false. Also you don't need the elseif statement: if($bid){ // code } else { // other code } Quote
TB1 Posted March 2, 2014 Author Report Posted March 2, 2014 Because I did the changes you suggested and it still isn't working. Quote
Tom Posted March 2, 2014 Report Posted March 2, 2014 Yeah you need to assign $bid... so whatever data you expect to be in there you need to put it in there. Quote
TB1 Posted March 2, 2014 Author Report Posted March 2, 2014 Well I want the data from the flights that have been bidded on but I'm not sure how to assign it... 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.