tagging as ATutor 1.5.4-release
[atutor.git] / themes / default / users / index.tmpl.php
1 <?php require(AT_INCLUDE_PATH.'header.inc.php'); ?>
2
3 <?php if (!$this->courses && get_instructor_status()): ?>
4         <?php global $msg; $msg->printInfos('NO_COURSES_INST'); ?>
5 <?php elseif (!$this->courses): ?>
6         <?php global $msg; $msg->printInfos('NO_COURSES'); ?>
7 <?php endif; ?>
8
9 <?php foreach ($this->courses as $row):?>       
10         <div class="course">
11                 <div style="font-size:smaller;" align="right"><?php
12                         $link  = '<a href="bounce.php?course=' . $row['course_id'] . '">';
13                         $link2 = '</a>';
14
15                         if ($_SESSION['member_id'] == $row['member_id']) {
16                                 //if instructor
17                                 echo _AT('instructor');
18                         } else if ($row['approved'] == 'a') {
19                                 //if alumni
20                                 echo _AT('alumni');
21                         } else if ($row['approved'] == 'n') {
22                                 //if notenrolled
23                                 echo _AT('pending_approval');
24                                 $link  = $link2 = "";
25                         } else {
26                                 //if no role and enrolled
27                                 echo _AT('student1');
28                         } ?>
29                 </div>
30                         <div class="body">
31                                 <?php if ($row['icon'] == ''): ?>
32                                                 <img src="images/clr.gif" class="icon" border="0" width="79" height="79" alt="" />
33                                 <?php else: ?>
34                                         <?php echo $link; ?>
35                                         <img src="images/courses/<?php echo $row['icon']; ?>" class="icon" border="0" alt="" />
36                                         <?php echo $link2; ?>
37                                 <?php endif; ?>
38
39                                 <strong><?php echo $link; ?><?php echo $row['title']; ?><?php echo $link2; ?></strong>
40
41                                 <?php if ($row['member_id'] != $_SESSION['member_id']): ?>
42                                         - <a href="users/remove_course.php?course=<?php echo $row['course_id']; ?>"><?php echo _AT('unenroll'); ?></a>
43                                 <?php endif; ?>
44
45                                 <br />
46  
47                                 <p>
48                                         <small><?php echo _AT('instructor');?>: <?php echo get_display_name($row['member_id']); ?>
49                                         <?php echo ' - <a href="'. $_base_href.'inbox/send_message.php?id='.$row['member_id'].'">'._AT('send_message').'</a>'; ?>
50                                         <br />
51                                         <?php echo _AT('category'); ?>: <?php echo get_category_name($row['cat_id']); ?><br />
52                                         
53                                         
54                                         <?php if ($row['tests']): ?>
55                                                 <?php echo _AT('tests'); ?>: 
56                                                 <?php foreach ($row['tests'] as $test): ?>
57                                                         <a href="bounce.php?course=<?php echo $row['course_id'].SEP.'p='.urlencode('tools/take_test.php?tid='.$test['test_id']); ?>"><?php echo $test['title']; ?></a> 
58                                                 <?php endforeach ;?>
59                                         <?php endif; ?>
60                                 </small>
61                                 </p>
62
63                                 <?php if ($row['last_cid']): ?>
64                                         <div class="shortcuts">
65                                                 <small><a href="bounce.php?course=<?php echo $row['course_id'].SEP.'p='.urlencode('content.php?cid='.$row['last_cid']); ?>"><?php echo _AT('resume'); ?></a></small>
66                                         </div>
67                                 <?php endif; ?>
68                         </div>
69         </div>
70 <?php endforeach; ?>
71
72 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>