Initial revision
[moodle.git] / course / user.php
CommitLineData
f9903ed0 1<?PHP // $Id$
2
3 require("../config.php");
4
5 require_variable($id); // course id
6 require_variable($user); // user id
7
8 if (! $course = get_record("course", "id", $id)) {
9 error("Course id is incorrect.");
10 }
11
12 require_login($course->id);
13
14 if (!isteacher($course->id)) {
15 error("Only teachers can look at this page");
16 }
17
18 if (! $user = get_record("user", "id", $user)) {
19 error("User ID is incorrect");
20 }
21
22 add_to_log("View total report of $user->firstname $user->lastname", $course->id);
23
24 print_header("$course->shortname: Report", "$course->fullname",
25 "<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> ->
26 <A HREF=\"../user/index.php?id=$course->id\">Participants</A> ->
27 <A HREF=\"../user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A> ->
28 Full Report", "");
29
30 if ($mods = get_records_sql("SELECT * FROM modules ORDER BY fullname")) {
31 foreach ($mods as $mod) {
32 $userfile = "$CFG->dirroot/mod/$mod->name/user.php";
33 if (file_exists($userfile)) {
34 echo "<H2>".$mod->fullname."s</H2>";
35 echo "<BLOCKQUOTE>";
36 include($userfile);
37 echo "</BLOCKQUOTE>";
38 echo "<HR WIDTH=100%>";
39 }
40 }
41 }
42
43 print_footer($course);
44
45?>
46