diff --git a/attendances.php b/attendances.php index 00b2eed..e56084a 100644 --- a/attendances.php +++ b/attendances.php @@ -234,7 +234,10 @@ $table->data[$student->id][] = "id}\">".((!$att && $update) ? '' : '').fullname($student).((!$att && $update) ? '' : '').''; foreach($statuses as $st) { - @$table->data[$student->id][] = 'id == $att->statusid ? 'checked' : '').'>'; + $copyid = ($copyfrom == "-1") ? $sessionid : $copyfrom; + $att = get_record('attendance_log', 'sessionid', $copyid, 'studentid', $student->id); + $currentstatusid = $att===false ? -1 : $att->statusid; + @$table->data[$student->id][] = 'id == $currentstatusid ? 'checked' : '').'>'; } $table->data[$student->id][] = ''; }