Last flight date

Nabeel, I have on the pilots page a last flight, if we have a new joiner with no flight this defaults to 01.Jan.1970 Example, http://www.easyjetva.com/index.php/pilots, if there any way to mod this out to display N/A or none as apposed to the date if no flight has been flown yet?

Just do something like

if(date == 0)
{
echo 'No flight';
}

date replaced with the right variable, it might be $pilot->lastpirep

OK so i was about to post for help but some coffee and logical thinking i have this working, it might not be the right way but its working lol:)

<?php

if($pilot->lastpirep == 0)
{
       echo 'No flight';
}
else
{
$report = PIREPData::GetLastReports($pilot->pilotid, 1);

echo date('d.M.Y', strtotime($report->submitdate));
}

?>
1 Like

That’s the right way

Hi,

which is the file?

OK so i was about to post for help but some coffee and logical thinking i have this working, it might not be the right way but its working lol:)

<?php if($pilot->lastpirep == 0) { echo 'No flight'; } else { $report = PIREPData::GetLastReports($pilot->pilotid, 1); echo date('d.M.Y', strtotime($report->submitdate)); } ?>

good job Mark

i give you a small pad on the back

Hi,

Which is the file and where it’s put???

Thanks!