id); add_to_log($course->id, "user", "view all", "index.php?id=$course->id", ""); if ($course->category) { print_header("$course->shortname: Participants", "$course->fullname", "id>$course->shortname -> Participants", ""); } else { print_header("$course->shortname: Participants", "$course->fullname", "Participants", ""); } $teacherlinks = isteacher($course->id); 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 "

".$course->teacher."s

"; foreach ($teachers as $teacher) { print_user($teacher, $course, $teacherlinks); } } 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 "

".$course->student."s

"; foreach ($students as $student) { print_user($student, $course, $teacherlinks); } } print_footer($course); /// FUNCTIONS ////////////////// function print_user($user, $course, $teacherlinks) { global $COUNTRIES; echo "
"; echo ""; echo "
"; echo "id&course=$course->id\">"; if ($user->picture) { echo "id/f1.jpg\">"; } else { echo ""; } echo ""; echo ""; echo ""; echo "$user->firstname $user->lastname"; echo "

Email: email\">$user->email
"; echo "Location: $user->city, ".$COUNTRIES["$user->country"]."
"; echo "Last access: ".userdate($user->lastaccess); echo "  (".format_time(time() - $user->lastaccess).")"; echo "

"; echo ""; if ($teacherlinks) { $timemidnight = usergetmidnight(time()); echo "id&user=$user->id\">Contributions
"; echo "id&user=$user->id&date=$timemidnight\">Today's logs
"; echo "id&user=$user->id\">All logs
"; echo "id&user=$user->id\">Unenrol
"; if (isstudent($course->id, $user->id)) { echo "id&user=$user->id\">Login as
"; } } echo "id&course=$course->id\">Full profile..."; echo "
"; echo "
"; } ?>