{$where}
GROUP BY atl.studentid, sts.setnumber, sts.acronym";
$this->userstakensessionsbyacronym = array();
- foreach ($DB->get_recordset_sql($sql, $params) AS $rec) {
+ $records = $DB->get_recordset_sql($sql, $params);
+ foreach ($records as $rec) {
$this->userstakensessionsbyacronym[$rec->userid][$rec->setnumber][$rec->acronym] = $rec->numtakensessions;
}
+ $records->close();
}
/**
}
$setnumber = -1;
- foreach ($reportdata->statuses AS $sts) {
+ foreach ($reportdata->statuses as $sts) {
if ($sts->setnumber != $setnumber) {
$colclass = empty($colclass) ? 'columncontrast' : null;
$setnumber = $sts->setnumber;
$usersummary = $reportdata->summary->get_taken_sessions_summary_for($user->id);
}
- foreach ($reportdata->statuses AS $sts) {
- $row->cells[] = isset($usersummary->userstakensessionsbyacronym[$sts->setnumber][$sts->acronym]) ?
- $usersummary->userstakensessionsbyacronym[$sts->setnumber][$sts->acronym] : 0;
+ foreach ($reportdata->statuses as $sts) {
+ if (isset($usersummary->userstakensessionsbyacronym[$sts->setnumber][$sts->acronym])) {
+ $row->cells[] = $usersummary->userstakensessionsbyacronym[$sts->setnumber][$sts->acronym];
+ } else {
+ $row->cells[] = 0;
+ }
}
$row->cells[] = $usersummary->numtakensessions;
$cell->style = 'white-space:nowrap;';
$statrow->cells[] = $cell;
}
- foreach ($reportdata->statuses AS $sts) {
+ foreach ($reportdata->statuses as $sts) {
$statrow->cells[] = '';
}
$statrow->cells[] = '';