id)) { error("Only teachers can view logs"); } if (isset($user) || isset($date)) { $userinfo = "all users"; $dateinfo = "any day"; if ($user) { if (!$u = get_record("user", "id", $user) ) { error("That's an invalid user!"); } $userinfo = "$u->firstname $u->lastname"; } if ($date) { $dateinfo = userdate($date, "l, j F Y"); } print_header("$course->shortname: Logs", "$course->shortname : Logs", "id\">$course->shortname -> id\">Logs -> Logs for $userinfo, $dateinfo", ""); print_heading("Logs for $userinfo, $dateinfo"); print_log_selector_form($course, $user, $date); print_log($course, $user, $date, "ORDER BY l.time DESC"); } else { print_header("$course->shortname: Logs", "$course->shortname : Logs", "id\">$course->shortname -> Logs", ""); print_heading("Choose which logs you want to look at"); print_log_selector_form($course); print_heading("Or see what is happening right now"); echo "