Moderators mark1million Posted January 31, 2009 Moderators Report Share Posted January 31, 2009 Hi, im trying to list on the pilots page the last date that a pilot flew, i have been playing with the <?php echo PilotData::GetFieldValue($pilot->pilotid, '*********'); ?> but not sure if that can work. Any sugestions please. Thanks Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted January 31, 2009 Author Moderators Report Share Posted January 31, 2009 No worries ill have a look at where the latest pireps get the info from Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted January 31, 2009 Author Moderators Report Share Posted January 31, 2009 Right i have a date in there now but its 1969, this is the format i used, have i missed something? <?php echo date(DATE_FORMAT, $report->submitdate); ?> Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 31, 2009 Administrators Report Share Posted January 31, 2009 Instead of DATE_FORMAT try 'm Y' just to test Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 1, 2009 Author Moderators Report Share Posted February 1, 2009 Changed to <?php echo date(d.m.Y, $report->submitdate); ?> Still get 31 12 1969, will try logging another flight see what happens Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 1, 2009 Administrators Report Share Posted February 1, 2009 What are you using to get the last PIREP? <?php echo date('d.m.Y', $report->submitdate); ?> Should be in quotes. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 1, 2009 Author Moderators Report Share Posted February 1, 2009 Still showing up as 31.12.1969, that's for all pilots Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 1, 2009 Administrators Report Share Posted February 1, 2009 How are you getting the last pirep? What function/which template Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 1, 2009 Author Moderators Report Share Posted February 1, 2009 this is the line im using in the pilots_list.tpl, <?php echo date('d.M.Y', $report->submitdate); ?> Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 1, 2009 Administrators Report Share Posted February 1, 2009 Where are you getting $report from, are you getting their latest PIREP? $report has to be assigned to something, for instance: http://phpvms.net/docs/api/phpvms/PIREPData.html#GetLastReports so <?php $report = PIREPData::GetLastReports($pilot->pilotid, 1); echo date('d.M.Y', $report->submitdate); ?> Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 2, 2009 Author Moderators Report Share Posted February 2, 2009 Still cant get to work I will have another play later on. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 3, 2009 Administrators Report Share Posted February 3, 2009 try this <?php $report = PIREPData::GetLastReports($pilot->pilotid, 1); echo date('d.M.Y', strtotime($report->submitdate)); ?> But since you're using the beta, you can do now: <?php echo date('d.M.Y', strtotime($pilot->lastpirep)); ?> I thought it made sense to just automatically log that. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 3, 2009 Author Moderators Report Share Posted February 3, 2009 <?php $report = PIREPData::GetLastReports($pilot->pilotid, 1); echo date('d.M.Y', strtotime($report->submitdate)); ?> That works Thank you Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 3, 2009 Administrators Report Share Posted February 3, 2009 Cool. When you update, use the 2nd one I posted, saves a query:) Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 3, 2009 Author Moderators Report Share Posted February 3, 2009 Tried that one first, it didn't seem to work. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted February 3, 2009 Administrators Report Share Posted February 3, 2009 Yeah, it's not populated right now with the latest pirep. I should perhaps have that in an update 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.