Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some "not defined" messages

  • Loading branch information...
commit 4c20cd82f20d309f59c9ac6550ff08ec04dae8a2 1 parent d08ffdd
paca70 authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 mod/attendance/view.php
8 mod/attendance/view.php
View
@@ -64,7 +64,9 @@
$sroll[$roll->userid][$roll->hour]->status=$roll->status;
$sroll[$roll->userid][$roll->hour]->notes=$roll->notes;
}
- }
+ } else {
+ $sroll = array(); //just to set default value
+ }
// get the list of attendance records for all hours of the given day and
// put it in the array for use in the attendance table
@@ -128,8 +130,8 @@
$abs=$tar=0;
for($j=1;$j<=$form->hours;$j++) {
// set the attendance defaults for each student
- if ($sroll[$student->id][$j]->status == 1) {$status=$T;$tar++;}
- elseif ($sroll[$student->id][$j]->status == 2) {$status=$A;$abs++;}
+ if (isset ($sroll[$student->id][$j]->status) && $sroll[$student->id][$j]->status == 1 ) {$status=$T;$tar++;}
+ elseif (isset ($sroll[$student->id][$j]->status) && $sroll[$student->id][$j]->status == 2 ) {$status=$A;$abs++;}
else {$status=$P;}
echo "<td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-left: 1px dotted; border-top: 1px solid;\">".$status."</td>\n";
} /// for loop
Please sign in to comment.
Something went wrong with that request. Please try again.