Doesn't display teachers or students if there aren't any

This commit is contained in:
martin 2002-06-05 05:54:47 +00:00
parent bda8d43a78
commit 619431ba3f

View File

@ -26,28 +26,24 @@
$teacherlinks = isteacher($course->id);
echo "<H2 align=center>".$course->teacher."s</H2>";
if ( $teachers = get_records_sql("SELECT u.* FROM user u, user_teachers t
WHERE t.course = '$course->id' AND t.user = u.id
ORDER BY t.authority")) {
echo "<H2 align=center>".$course->teacher."s</H2>";
foreach ($teachers as $teacher) {
print_user($teacher, $course, $teacherlinks);
}
} else {
notify("None yet");
}
echo "<H2 align=center>".$course->student."s</H2>";
if ($students = get_records_sql("SELECT u.* FROM user u, user_students s
WHERE s.course = '$course->id' AND s.user = u.id
ORDER BY u.lastaccess DESC")) {
echo "<H2 align=center>".$course->student."s</H2>";
foreach ($students as $student) {
print_user($student, $course, $teacherlinks);
}
} else {
notify("None yet");
}
}
print_footer($course);