move code up one directory
[atutor.git] / themes / default / inbox / inbox.tmpl.php
1
2 <?php 
3         if ($row = mysql_fetch_assoc($this->result_messages)) {
4 ?>
5         <ul id="inbox-msg">
6         <li>
7                 <div class="forum-post-author">
8                         <a href="profile.php?id=<?php echo $row['from_member_id']; ?>" class="title"><?php echo get_display_name($row['from_member_id']); ?></a><br />
9                         <?php print_profile_img($row['from_member_id']); ?>
10                 </div>
11
12                 <div class="forum-post-content">
13                         <h3><?php echo AT_print($row['subject'], 'messages.subject'); ?></h3>
14                         <div>
15                                 <div class="forum-post-ctrl">
16                                         <a href="inbox/send_message.php?reply=<?php echo $_GET['view']; ?>"><?php echo _AT('reply'); ?></a> | <a href="<?php echo $_SERVER['PHP_SELF']; ?>?delete=<?php echo $_GET['view']; ?>"><?php echo _AT('delete'); ?></a>
17                                 </div>
18                                 <p class="date"><?php echo AT_date(_AT('forum_date_format'), $row['date_sent'], AT_DATE_MYSQL_DATETIME); ?></p>
19                         </div>
20
21                         <div class="body">
22                                 <p><?php echo AT_print($row['body'], 'messages.body'); ?></p>
23                         </div>
24                 </div>
25
26         </li>
27         </ul><br /><br />
28         <?php
29         }
30 ?>
31         
32 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="form" >
33 <table class="data" summary="" rules="rows" width="55%">
34 <thead>
35 <tr>
36         <th scope="col">&nbsp;</th>
37         <th scope="col">&nbsp;</th>
38         <th scope="col" ><?php echo _AT('from');   ?></th>
39         <th scope="col" ><?php echo _AT('subject');?></th>
40         <th scope="col" ><?php echo _AT('date');   ?></th>
41 </tr>
42 </thead>
43 <tfoot>
44 <tr>
45         <td colspan="5"><input type="submit" name="delete" value="<?php echo _AT('delete'); ?>"/></td>
46 </tr>
47 </tfoot>
48 <tbody>
49 <?php if ($row = mysql_fetch_assoc($this->result)): ?>
50         <?php do { ?>
51                 <?php if ($row['message_id'] == $_GET['view']): ?>
52                         <tr class="selected">
53                 <?php else: ?>
54                         <tr onmousedown="document.form['m<?php echo $row['message_id']; ?>'].checked = !document.form['m<?php echo $row['message_id']; ?>'].checked; rowselectbox(this, document.form['m<?php echo $row['message_id']; ?>'].checked, '');" id="r_<?php echo $row['message_id']; ?>_1">
55                 <?php endif; ?>
56                 <td><input type="checkbox" name="id[]" value="<?php echo $row['message_id']; ?>" id="m<?php echo $row['message_id']; ?>" <?php if (isset($_POST['id']) && in_array($row['message_id'], $_POST['id'])) { echo 'checked="checked"'; } ?> title="<?php echo _AT('delete').': '.AT_print($row['subject'], 'messages.subject');?>" onmouseup="this.checked=!this.checked" /></td>
57                 <td valign="middle">
58                 <?php
59                 if ($row['new'] == 1)   {
60                         echo _AT('new');
61                 } else if ($row['replied'] == 1) {
62                         echo _AT('replied');
63                 }
64                 echo '</td>';
65
66                 $name = get_display_name($row['from_member_id']);
67
68                 echo '<td align="left" valign="middle">';
69
70                 if ($_GET['view'] != $row['message_id']) {
71                         echo $name;
72                 } else {
73                         echo '<strong>'.$name.'</strong>';
74                 }
75                 echo '</td>';
76
77                 echo '<td><label for="m'.$row['message_id'].'">';
78                 if ($_GET['view'] != $row['message_id']) {
79                         echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$row['message_id'].'">'.AT_print($row['subject'], 'messages.subject').'</a>';
80                 } else {
81                         echo '<strong>'.AT_print($row['subject'], 'messages.subject').'</strong>';
82                 }
83                 echo '</label></td>';
84         
85                 echo '<td valign="middle" align="left" nowrap="nowrap">';
86                 echo AT_date(_AT('inbox_date_format'),  $row['date_sent'], AT_DATE_MYSQL_DATETIME);
87                 echo '</td>';
88                 echo '</tr>';
89         } while ($row = mysql_fetch_assoc($this->result)); ?>
90 <?php else: ?>
91         <tr>
92                 <td colspan="5"><?php echo _AT('none_found'); ?></td>
93         </tr>
94 <?php endif; ?>
95 </tbody>
96 </table>
97 </form>