Steve Bartlett Posted April 5, 2017 Report Posted April 5, 2017 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 } } ?> Quote
Moderators ProSkyDesign Posted April 6, 2017 Moderators Report Posted April 6, 2017 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> Quote
Steve Bartlett Posted April 6, 2017 Author Report Posted April 6, 2017 Didn't work, still getting 01/01/1970 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.