Jump to content

Pilots Last Flight


Angel Air

Recommended Posts

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

Screenshot_4.png

Link to comment
Share on other sites

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 by flyalaska
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

  • 9 months later...
  • 1 year later...
  • 1 month later...
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 ??

Link to comment
Share on other sites

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