Jump to content

Front Page Recent Flights


Steve Bartlett

Recommended Posts

On the Recent Flights on the front Page of the website it keeps showing the date of  01/01/1970, it should show the date the Pirep was filed.

Here is the code I am using:

            <?php # RECENT FLIGHTS ;?>
            <div class="col-md-6">
            <div class="hr-title hr-long center"><abbr>Recent Flights</abbr></div>
                <div class="table-responsive">
                      <table class="table table-condensed table-hover">
                        <thead>
                          <tr>
                            <th>Flight</th>
                            <th>Route</th>
                            <th>Date</th>
                          </tr>
                        </thead>
                        <tbody>
                            <?php

                            $pirep_list = PIREPData::getRecentReportsByCount(5);
                            if($pirep_list){
                            foreach($pirep_list as $pirep) {
                            ?>
                            <tr>
                            <td><a href="<?php echo url('/pireps/viewreport/'.$pirep->pirepid);?>"><?php echo $pirep->code.$pirep->flightnum?></a></td>
                            <td><?php echo $pirep->depicao.' - '.$pirep->arricao;?></td>   
                            <td><?php echo date(DATE_FORMAT, strtotime($report->submitdate)); ?></td>
                          </tr>
                            <?php
                            } }
                            ?>

Link to comment
Share on other sites

  • Moderators
9 hours ago, Steve Bartlett said:

On the Recent Flights on the front Page of the website it keeps showing the date of  01/01/1970, it should show the date the Pirep was filed.

Here is the code I am using:

            <?php # RECENT FLIGHTS ;?>
            <div class="col-md-6">
            <div class="hr-title hr-long center"><abbr>Recent Flights</abbr></div>
                <div class="table-responsive">
                      <table class="table table-condensed table-hover">
                        <thead>
                          <tr>
                            <th>Flight</th>
                            <th>Route</th>
                            <th>Date</th>
                          </tr>
                        </thead>
                        <tbody>
                            <?php

                            $pirep_list = PIREPData::getRecentReportsByCount(5);
                            if($pirep_list){
                            foreach($pirep_list as $pirep) {
                            ?>
                            <tr>
                            <td><a href="<?php echo url('/pireps/viewreport/'.$pirep->pirepid);?>"><?php echo $pirep->code.$pirep->flightnum?></a></td>
                            <td><?php echo $pirep->depicao.' - '.$pirep->arricao;?></td>   
                            <td><?php echo date(DATE_FORMAT, strtotime($report->submitdate)); ?></td>
                          </tr>
                            <?php
                            } }
                            ?>

Replace 

<td><?php echo date(DATE_FORMAT, strtotime($report->submitdate)); ?></td>

for:

<td><?php echo date(DATE_FORMAT, strtotime($pirep->submitdate)); ?></td>

 

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