8d1508996489ebb800d6306925c1ea1befe35317
[atutor.git] / docs / themes / default / directory.tmpl.php
1 <?php\r
2 /************************************************************************/\r
3 /* ATutor                                                                                                                               */\r
4 /************************************************************************/\r
5 /* Copyright (c) 2002-2010                                              */\r
6 /* Inclusive Design Institute                                           */\r
7 /* http://atutor.ca                                                                                                             */\r
8 /*                                                                                                                                              */\r
9 /* This program is free software. You can redistribute it and/or        */\r
10 /* modify it under the terms of the GNU General Public License          */\r
11 /* as published by the Free Software Foundation.                        */\r
12 /************************************************************************/\r
13 // $Id: directory.tmpl.php 3111 2005-01-18 19:32:00Z joel $\r
14 ?>\r
15 <form name="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">\r
16 \r
17 <div class="input-form">\r
18         <div class="row">\r
19                 <?php echo _AT('online_status'); ?><br />\r
20                 <input type="radio" name="online_status" id="s1" value="1" <?php echo $this->on; ?>  /><label for="s1"><?php echo _AT('user_online');  ?></label>\r
21                 <input type="radio" name="online_status" id="s0" value="0" <?php echo $this->off; ?> /><label for="s0"><?php echo _AT('user_offline'); ?></label>\r
22                 <input type="radio" name="online_status" id="s2" value="2" <?php echo $this->all; ?> /><label for="s2"><?php echo _AT('all');          ?></label>\r
23         </div>\r
24 \r
25                 <div class="row">\r
26 \r
27                         <label for="groups"><?php echo _AT('groups'); ?></label><br />\r
28                         <select name="group" id="groups">\r
29                                 <option value="0" id="g0" ><?php echo _AT('entire_course'); ?></option>\r
30                         <?php while ($row = mysql_fetch_assoc($this->result_groups)): ?>\r
31                                 <option value="<?php echo $row['group_id']; ?>" id="g<?php echo $row['group_id']; ?>" <?php if ($group == $row['group_id']) { echo 'selected="selected"'; } ?> ><?php echo $row['type_title'] . ': ' . $row['title']; ?></option>\r
32                         <?php endwhile; ?>\r
33                         </select>\r
34 \r
35                 </div>\r
36 \r
37         <div class="row buttons">\r
38                 <input type="submit" name="submit" value="<?php echo _AT('filter'); ?>" />\r
39                 <input type="submit" name="reset_filter" value="<?php echo _AT('reset_filter'); ?>" />\r
40         </div>\r
41 </div>\r
42 </form>\r
43 \r
44 <table class="data" rules="cols" summary="">\r
45 <thead>\r
46 <tr>\r
47         <th scope="col"><?php echo _AT('login_name'); ?></th>\r
48         <th scope="col"><?php echo _AT('full_name'); ?></th>\r
49         <th scope="col"><?php echo _AT('status'); ?></th>\r
50         <th scope="col"><?php echo _AT('online_status'); ?></th>\r
51 </tr>\r
52 </thead>\r
53 <tbody>\r
54 <?php\r
55 if ($this->final) {\r
56         foreach ($this->final as $user_id=>$attrs) {\r
57                 echo '<tr onmousedown="document.location=\''.$this->base_href.'profile.php?id='.$user_id.'\'">';\r
58                 $type = 'class="user"';\r
59                 if ($system_courses[$_SESSION['course_id']]['member_id'] == $user_id) {\r
60                         $type = 'class="user instructor" title="'._AT('instructor').'"';\r
61                 }\r
62                 echo '<td><a href="profile.php?id='.$user_id.'" '.$type.'>'.AT_print($attrs['login'], 'members.login') . '</a></td>';\r
63 \r
64                 //echo '<td>'.AT_print($attrs['first_name'] .' '. $attrs['second_name'] .' '. $attrs['last_name'],'members.first_name').'</td>';\r
65                 echo '<td>'.AT_print(get_display_name($user_id), 'members.full_name').'</td>';  \r
66                 \r
67                 if ($attrs['privileges'] != 0) {\r
68                         echo '<td>'._AT('assistant').'</td>';\r
69                 } else if ($attrs['approved'] == 'a') {\r
70                         /* if alumni display alumni */\r
71                         echo '<td>'._AT('alumni').'</td>';\r
72                 } else if ($attrs['approved'] == 'y') {\r
73                         if ($user_id == $system_courses[$_SESSION['course_id']]['member_id']) {\r
74                                 echo '<td>'._AT('instructor').'</td>';\r
75                         } else {\r
76                                 echo '<td>'._AT('enrolled').'</td>';\r
77                         }\r
78                 } else {\r
79                         echo '<td></td>';\r
80                 }\r
81                 \r
82                 if ($attrs['online'] == TRUE) {\r
83                         echo '<td><strong>'._AT('user_online').'</strong></td>';\r
84                 } else {\r
85                         echo '<td>'._AT('user_offline').'</td>';\r
86                 }\r
87 \r
88                 echo '</tr>';\r
89         }       \r
90 } else {\r
91         echo '<tr><td colspan="3">' . _AT('none_found') . '</td></tr>';\r
92 }\r
93 ?>\r
94 </tbody>\r
95 </table>\r