move code up one directory
[atutor.git] / themes / simplified-desktop / inbox / sent_messages.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['to_member_id']; ?>" class="title"><?php echo get_display_name($row['to_member_id']); ?></a><br />
9                         <?php print_profile_img($row['to_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?forward=<?php echo $_GET['view']; ?>"><?php echo _AT('forward'); ?></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 style="clear: both; font-size:0.1em"></div>
25                 </div>
26         </li>
27         </ul>
28         <?php
29         }
30 ?>
31
32 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="form">
33 <div class="table-surround">
34 <table class="data" >
35 <thead>
36 <tr>
37         <th scope="col">&nbsp;</th>
38         <th scope="col" ><?php echo _AT('to');   ?></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="4">
46                 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>"/>
47                 <input type="submit" name="move" value="<?php echo _AT('move_to_inbox'); ?>"/>
48         </td>
49 </tr>
50 </tfoot>
51 <tbody>
52 <?php if ($row = mysql_fetch_assoc($this->result)): ?>
53         <?php do { ?>
54                 <?php if ($row['message_id'] == $_GET['view']): ?>
55                         <tr class="selected">
56                 <?php else: ?>
57                         <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">
58                 <?php endif; ?>
59                 <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>
60                 <?php
61
62                 $name = get_display_name($row['to_member_id']);
63
64                 echo '<td align="left" valign="middle">';
65
66                 if ($_GET['view'] != $row['message_id']) {
67                         echo $name;
68                 } else {
69                         echo '<strong>'.$name.'</strong>';
70                 }
71                 echo '</td>';
72
73                 echo '<td><label for="m'.$row['message_id'].'">';
74                 if ($_GET['view'] != $row['message_id']) {
75                         echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$row['message_id'].'">'.AT_print($row['subject'], 'messages.subject').'</a>';
76                 } else {
77                         echo '<strong>'.AT_print($row['subject'], 'messages.subject').'</strong>';
78                 }
79                 echo '</label></td>';
80         
81                 echo '<td valign="middle" align="left" nowrap="nowrap">';
82                 echo AT_date(_AT('forum_date_format'),  $row['date_sent'], AT_DATE_MYSQL_DATETIME);
83                 echo '</td>';
84                 echo '</tr>';
85         } while ($row = mysql_fetch_assoc($this->result)); ?>
86 <?php else: ?>
87         <tr>
88                 <td colspan="4"><?php echo _AT('none_found'); ?></td>
89         </tr>
90 <?php endif; ?>
91 </tbody>
92 </table>
93 </div>
94 </form>