if (empty($lastrun)) {
$lastrun = 0;
}
+ if (!empty($lastrun)) {
+ mtrace("Get warnings to send for sessions that have ended since: ".userdate($lastrun));
+ }
$orderby = 'ORDER BY cm.id, atl.studentid, n.warningpercent ASC';
$records = attendance_get_users_to_notify(array(), $orderby, $lastrun, true);
GROUP BY attendanceid, setnumber) stm
ON (stm.setnumber = ats.statusset AND stm.attendanceid = ats.attendanceid)
{$joingroup}
- WHERE ats.sessdate >= {$sincetime} {$where}
+ WHERE (ats.sessdate + ats.duration) >= {$sincetime} {$where}
AND ats.lasttaken != 0
GROUP BY uniqueid, a.id, a.name, a.course, c.fullname, atl.studentid, n.id, n.warningpercent,
n.emailsubject, n.emailcontent, n.emailcontentformat, n.warnafter,