mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Doesn't display teachers or students if there aren't any
This commit is contained in:
parent
bda8d43a78
commit
619431ba3f
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user