$table->align = array ("LEFT", "LEFT", "LEFT");
}
- foreach ($attendances as $attendance) {
+ if ($attendances) foreach ($attendances as $attendance) {
if (!$attendance->visible) {
//Show dimmed if the mod is hidden
$link = "<A class=\"dimmed\" HREF=\"view.php?id=$attendance->coursemodule\">$attendance->name</A>";
if ($data = data_submitted()) {
// Peel out all the data from variable names.
$attrec->dayid = $attendance->id;
- foreach ($data as $key => $val) {
+ if ($data) foreach ($data as $key => $val) {
$pieces = explode('_',$key);
if ($pieces[0] == 'student') {
$attrec->userid=$pieces[1];
} else {
// build array of all tardies
$tarr = array();
- foreach ($tardyrecs as $tardyrec) {
+ if ($tardyrecs) foreach ($tardyrecs as $tardyrec) {
array_push($tarr, $tardyrec->hour);
$tardystring = $tardystring . ", " . $tardyrec->hour;
}
} else {
// build array of all absences
$aarr = array();
- foreach ($absrecs as $absrec) {
+ if ($absrecs) foreach ($absrecs as $absrec) {
array_push($aarr, $absrec->hour);
}
$end=array_pop($aarr);
}
$td = attendance_find_today(time());
$tm = attendance_find_tomorrow(time());
- foreach($attendances as $attendance) {
+ if ($attendances) foreach($attendances as $attendance) {
if (($attendance->day >=$td ) && ($attendance->day < $tm)) {
echo "Attendance: Taking attendance for $attendance->name\n";
$students = attendance_get_course_students($form->course, "u.lastname ASC");
$i=0;
- foreach ($students as $student) {
+ if ($students) foreach ($students as $student) {
echo "<tr><td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->lastname."</td>\n";
echo "<td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->firstname."</td>\n";
echo "<td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->idnumber."</td>\n";
$students = attendance_get_course_students($form->course, "u.lastname ASC");
$i=0;
- foreach ($students as $student) {
+ if ($students) foreach ($students as $student) {
echo "<tr><td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->lastname."</td>\n";
echo "<td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->firstname."</td>\n";
echo "<td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->idnumber."</td>\n";
}
?>
+
+http://www.alpine-usa.com/company_info/press_release/010804_ipad.html
-<? // $Id$
+sou<? // $Id$
/// This page prints all instances of attendance in a given week
require_once("../../config.php");
/// create an array of all the attendance objects for the week
$numatt=0;
$numhours=0;
- foreach ($attendances as $attendance){
+ if ($attendances) foreach ($attendances as $attendance){
// store the raw attendance object
$cm = get_coursemodule_from_instance("attendance", $attendance->id, $course->id);
$attendance->cmid = $cm->id;
$T = get_string("tardyshort","attendance");
$P = get_string("presentshort","attendance");
$row=4;
- foreach ($students as $student) {
+ if ($students) foreach ($students as $student) {
$myxls->write_string($row,0,$student->lastname);
$myxls->write_string($row,1,$student->firstname);
$studentid=(($student->idnumber != "") ? $student->idnumber : " ");
$T = get_string("tardyshort","attendance");
$P = get_string("presentshort","attendance");
$row=3;
- foreach ($students as $student) {
+ if ($students) foreach ($students as $student) {
echo $student->lastname;
echo "\t".$student->firstname;
$studentid=(($student->idnumber != "") ? $student->idnumber : " ");
$A = get_string("absentshort","attendance");
$T = get_string("tardyshort","attendance");
$P = get_string("presentshort","attendance");
- foreach ($students as $student) {
+ if ($students) foreach ($students as $student) {
if (isteacher($course->id)) {
echo "<tr><td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->lastname."</td>\n";
echo "<td align=\"left\" nowrap class=\"generaltablecell\" style=\"border-top: 1px solid;\">".$student->firstname."</td>\n";