Angel Air Posted February 27, 2017 Report Share Posted February 27, 2017 Hi all I am trying to show the below code on the profile_main.php but can't get any of the data to show. Here is the code, I have taken this from pirep_viewreport.php <b>Departure Airport</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->depname?> (<?php echo $pirep->depicao; ?>)</p> </li> <li class="list-group-item"> <b>Arrival Airport</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->arrname?> (<?php echo $pirep->arricao; ?>)</p> </li> <li class="list-group-item"> <b>Aircraft</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->aircraft . " ($pirep->registration)"?></p> </li> <li class="list-group-item"> <b>Flight Time</b> <p class="pull-right" style="color: #3C8DBC"><?php echo $pirep->flighttime; ?></p> </li> <li class="list-group-item"> <b>Date Submitted</b> <p class="pull-right" style="color: #3C8DBC"><?php echo date(DATE_FORMAT, $pirep->submitdate);?></p> </li> <?php if($pirep->route != '') { echo '<li class="list-group-item"><b>Route</b> <p class="pull-right" style="color: #3C8DBC">'.$pirep->route.'</p></li>'; } ?> <li class="list-group-item"><b>Status</b> <?php if($pirep->accepted == PIREP_ACCEPTED) echo '<div class="label label-success pull-right">Accepted</div>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<div class="label label-danger pull-right">Rejected</div>'; elseif($pirep->accepted == PIREP_PENDING) echo '<div class="label label-info pull-right">Approval Pending</div>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<div class="label label-warning pull-right">Flight in Progress</div>'; ?> Here is what I see when I add this code to profile_main.php Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 28, 2017 Report Share Posted February 28, 2017 (edited) I have this on my site with simpilots 5.5.2 Days Since Last Flight <?php if ($userinfo->lastpirep == '0000-00-00 00:00:00') { echo 'There are no flights!'; } else { $datebefore1 = substr($userinfo->lastpirep, 0, 10); $datetoday2 = date("Y-m-d"); $datebefore3 = strtotime($datebefore1); $datetoday4 = strtotime($datetoday2); $newdate = $datetoday4-$datebefore3; $lastpirep = floor($newdate/(60*60*24)); echo ' '; if ($lastpirep == 0) { echo 'Today'; } else if ($lastpirep == 1) { echo 'Yesterday'; } else { echo $lastpirep . ' Days ago'; } } ?> Latest Flight Number <?php if($report) { ?> <a href="<?php echo url('pireps/view/'.$report->pirepid); ?>"><?php echo $report->code . $report->flightnum; ?></a> <?php } else { echo 'No PIREPs filed yet!'; } ?> Last Flight Date <?php echo date('m/d/Y', strtotime($userinfo->lastpirep));?> Edited February 28, 2017 by flyalaska Quote Link to comment Share on other sites More sharing options...
Angel Air Posted March 1, 2017 Author Report Share Posted March 1, 2017 Thank you I have used your codes and adapted it slightly, until I can figure the above out. Thanks again Scott Quote Link to comment Share on other sites More sharing options...
Heritage1 Posted March 2, 2017 Report Share Posted March 2, 2017 Thanks flyalaska, that was exactly my idea for him, however with a few bells and whistles using of course the infamous <table> , <td>, <tr> etc, which will allow for columns, colors, bgcolors etc. Sorry I couldn't get back to you right away, but flyalaska definately has the right idea. Jimbo 1 Quote Link to comment Share on other sites More sharing options...
thefiercepilot Posted December 16, 2017 Report Share Posted December 16, 2017 (edited) Can I use this for displaying date of last pirep? <?php if(!$pireps) { $lastflight="Never"; } else { $lastflight=date('m/d/Y', strtotime($userinfo->lastpirep)); } ?> Edited December 16, 2017 by thefiercepilot Quote Link to comment Share on other sites More sharing options...
sayedzaafir Posted February 9, 2019 Report Share Posted February 9, 2019 can anyone tell me how to get the dept airport and arr airport of last flown flight and the flight time thank you Quote Link to comment Share on other sites More sharing options...
flyalaska Posted February 10, 2019 Report Share Posted February 10, 2019 10 hours ago, sayedzaafir said: can anyone tell me how to get the dept airport and arr airport of last flown flight and the flight time thank you I just have the last flight date. <?php echo date('m/d/Y', strtotime($userinfo->lastpirep));?> Quote Link to comment Share on other sites More sharing options...
sayedzaafir Posted March 19, 2019 Report Share Posted March 19, 2019 On 2/27/2017 at 1:16 PM, Angel Air said: <?php if($pirep->accepted == PIREP_ACCEPTED) echo '<div class="label label-success pull-right">Accepted</div>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<div class="label label-danger pull-right">Rejected</div>'; elseif($pirep->accepted == PIREP_PENDING) echo '<div class="label label-info pull-right">Approval Pending</div>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<div class="label label-warning pull-right">Flight in Progress</div>'; ?> i tried this but it dint work , any updated code for it ?? 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.