Hello
I have a list dailylogs with three elements - {dailylogs___weight}, {dailylogs___bp},{dailylogs___sugar}. Users enter data every day, but I would like to generate a summary report every week, say every Saturday. In that email template I send out, I want to capture the average of the last seven entries, or entries from date1 to today, whichever is easier. I want this to be stored as $weeklyavgwt $weeklyavgbp and $weeklyavgsugar.
Secondly, I am calculating a day element as follows -
$id = (int)'{dailylogs___dayid}';
$date=new DateTime();
$date->setDate(2020,8,8);
$date->modify('+'.$id. 'day');
return $date->format('D');
This was supposed to calculate and store Days (Mon, Tue etc) on the fly, and based on if today = Sat, trigger an email report. Something is going wrong and $id is returning 0 every case.
Can someone help how I can calculate these three average variables, and also set a weekly email plugin? Thanks a bunch.
I have a list dailylogs with three elements - {dailylogs___weight}, {dailylogs___bp},{dailylogs___sugar}. Users enter data every day, but I would like to generate a summary report every week, say every Saturday. In that email template I send out, I want to capture the average of the last seven entries, or entries from date1 to today, whichever is easier. I want this to be stored as $weeklyavgwt $weeklyavgbp and $weeklyavgsugar.
Secondly, I am calculating a day element as follows -
$id = (int)'{dailylogs___dayid}';
$date=new DateTime();
$date->setDate(2020,8,8);
$date->modify('+'.$id. 'day');
return $date->format('D');
This was supposed to calculate and store Days (Mon, Tue etc) on the fly, and based on if today = Sat, trigger an email report. Something is going wrong and $id is returning 0 every case.
Can someone help how I can calculate these three average variables, and also set a weekly email plugin? Thanks a bunch.