<?cs include:"util.cs" ?>



<?cs def:print_attachments() ?>
  <?cs if:website_attached ?>
   <div class="regheading"><?cs var:lang.website_attached ?></div>
  <?cs elif:attachment_count ?>
     <table cellspacing="0" cellpadding="4" border="4">
     <caption class="regheading"><?cs var:lang.attachment_label ?></caption>
     <tr class="table_heading"><td align="center"><?cs var:lang.filename_heading ?></td><td align="center"><?cs var:lang.filesize_heading ?></td></tr>
     <?cs each:this = attachment ?>
      <tr>
         <td><?cs var:this.filename ?></td>
         <td align="right"><?cs var:this.size ?></td>
      </tr>
     <?cs /each ?>
     </table> 
  <?cs /if ?>
<?cs /def ?>


<?cs def:print_row(label, value) ?>
  <tr>
    <td <?cs if:label ?>class="table_heading" <?cs /if ?>><?cs var:label ?>&nbsp;</td>
    <td><?cs var:value ?></td>
  </tr>
<?cs /def ?>



<?cs def:print_recipients(label, list) ?>
  <?cs each:this = list ?>
   <?cs if:!name(this) ?>
     <?cs call:print_row(label, this.realname) ?>
   <?cs else ?>
     <?cs call:print_row("", this.realname) ?>
   <?cs /if ?>
  <?cs /each ?>
<?cs /def ?>


<?cs def:print_inbox_info() ?>
<?cs with:lang=lang.post_inbox_outbox_info ?>
 <table width="100%">
 <tr><td align="center">
  <table cellspacing="0" cellpadding="4" border="4">
   <?cs call:print_row(lang.subject_label, subject) ?>
   <?cs call:print_row(lang.from_label, from) ?>
   <?cs call:print_row(lang.time_label, time_sent) ?>
   <?cs call:print_recipients(lang.to_label, to) ?>
   <?cs if:cc_count ?>
       <?cs call:print_recipients(lang.cc_label, cc) ?>
   <?cs /if ?> 
   <?cs if:bcc_count ?>
        <?cs call:print_recipients(lang.bcc_label, bcc) ?>
   <?cs /if ?>
   </table> 
   <br />
   <?cs call:print_attachments() ?>

 </td></tr>
 </table>
<?cs /with ?>
<?cs /def ?> 






<?cs def:print_outbox_recipients(label, recipient_list) ?>
    <?cs each:myto = recipient_list ?>
       <tr><td <?cs if:!name(myto) ?>class="table_heading"<?cs /if ?>><?cs if:!name(myto) ?><?cs var:label ?><?cs /if ?></td>
     <td><?cs var:myto.realname ?></td>
     <?cs if:myto.time_read ?> 
     <td><?cs var:myto.time_read ?></td>
     <?cs else ?>
       <td>&nbsp;</td>
     <?cs /if ?>
     <?cs if:myto.time_deleted ?>
     <td><?cs var:myto.time_deleted ?></td>
     <?cs else ?>
       <td>&nbsp;</td>
     <?cs /if ?>
     </tr>
    <?cs /each ?>
<?cs /def ?> 




<?cs def:print_outbox_info() ?>
<?cs with:lang=lang.post_inbox_outbox_info ?>
 <table width="100%">
 <tr><td align="center">
  <table cellspacing="0" cellpadding="4" border="4">
    <tr>
       <td class="table_heading"><?cs var:lang.subject_label ?></td>
       <td colspan="3"><?cs var:subject ?></td>
    </tr>
    <tr>
       <td class="table_heading"><?cs var:lang.time_label ?></td>
       <td colspan="3"><?cs var:sent_time ?></td>
    </tr>
    <tr>
       <td colspan="2"></td>
       <td class="table_heading" align="center"><?cs var:lang.opened_label ?></td> 
       <td class="table_heading" align="center"><?cs var:lang.deleted_label ?></td> 
    </tr>
    <?cs call:print_outbox_recipients(lang.to_label, to) ?>
    <?cs call:print_outbox_recipients(lang.cc_label, cc) ?>
  </table> 
  <br />
  <?cs call:print_attachments() ?>
 </td></tr>
</table>
<?cs /with ?>
<?cs /def ?> 


<?cs call:html_heading() ?>
   <head>
      <title><?cs var:course_no ?> <?cs if:is_outbox ?><?cs var:lang.post_inbox_outbox_info.outbox_title ?><?cs else ?><?cs var:lang.post_inbox_outbox_info.inbox_title ?><?cs /if ?></title>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css"  />
  </head>
<?cs call:define_body() ?>
 <?cs call:print_course_heading("javascript:history.back()", lang.post_inbox_outbox_info.back_button_title) ?>
 <div class="center_msg">
  <span class="alert_color"><?cs if:is_outbox ?><?cs var:lang.post_inbox_outbox_info.outbox_title ?><?cs else ?><?cs var:lang.post_inbox_outbox_info.inbox_title ?><?cs /if ?> </span>
  <br /><?cs var:current_time ?>
 </div>
<?cs if:is_outbox ?>
   <?cs call:print_outbox_info() ?>
<?cs else ?>
   <?cs call:print_inbox_info() ?>
<?cs /if ?>
</body>
</html>
<?cs call:runtime() ?> 
