This topic is locked

Number Of Days Lapsed

6/17/2013 8:05:24 PM
PHPRunner General questions
H
holdenslx author

Currently I'm running PHP Runner 6.1 Build 12231.
I've created a PHP application which has now been in operation on my website for about 6 months being used successfully by my members. I have created a member Application which displays a roster, of which I need to somehow include a new field to be displayed.
The field I want is to display the number of days that have passed since a member last submitted a logbook entry, I want this field to auto calculate the number of days that have lapsed by referencing their last logbook entry using the time stamp of that entry.
The member logbook contains a date field that is displays the date of their last submission which is the TIMESTAMP field from the logbook table - Attributes "on update CURRENT_TIMESTAMP"
Is there anyway that I can achieve this?
Regard

Peter

C
cgphp 6/18/2013

Set the new field (or the alias field) as "Custom" and add the following code:

$value = (time() - $data['logbook_date']) / (3600 * 24);



Replace logbook_date with the real name of "last submitted logbook entry" date field.

H
holdenslx author 6/22/2013



Set the new field (or the alias field) as "Custom" and add the following code:

$value = (time() - $data['logbook_date']) / (3600 * 24);



Replace logbook_date with the real name of "last submitted logbook entry" date field.


Hi Cristian,
Thanks for the response, I'm still a newbie to this. The new field your referring to it needs to be created in Mysql database, not sure how to create a new field as a custom and where to add the code.
The roster page that is currently made up of 3 different tables linked to display the required data.
Cheers

Peter

C
cgphp 6/24/2013

You can learn more about Custom field here: http://xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm