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

<?cs def:print_button(value, url, help, winname) ?>
  <input type="button"  value="<?cs var:value ?>" title="<?cs var:help ?>" onclick="javascrip:window.open('<?cs var:url ?>','<?cs var:winname ?>','menubar=1,resizable=1,width=700,height=600,top=20,left=20,scrollbars=1')" />
<?cs /def ?>


<?cs def:print_delete_button(value, url, help, winname) ?>
  <input type="button"  value="<?cs var:value ?>" title="<?cs var:help ?>" onclick="javascript:window.open('<?cs var:url ?>','<?cs var:winname ?>','menubar=0,resizable=0,width=300,height=200,top=20,left=20,scrollbars=0')" />
<?cs /def ?>

<?cs def:print_log_files() ?>
  <div><form action="">
  <table cellspacing="0" cellpadding="3" border="1">
  <tr>
     <?cs each:this = lang.super_roster_log_list.heading ?>
      <th><?cs var:this ?></th>
      <?cs /each ?> 
  </tr>
  <?cs each:one = log ?>
    <tr>
      <td><?cs var:one.filename ?></td>
      <td><?cs var:one.last_time ?></td>
      <td><?cs var:one.size ?></td>
      <td><?cs call:print_button(lang.super_roster_log_list.view, one.detail_url, lang.super_roster_log_list.view_help, "graphwin") ?></td>
    <?cs if:one.delete_url ?>
      <td><?cs call:print_delete_button(lang.super_roster_log_list.delete, one.delete_url, lang.super_roster_log_list.delete_help, "deletewin") ?></td>
      <?cs else ?>
      <td>&nbsp;</td> 
    <?cs /if ?>
  </tr>
  <?cs /each ?> 
 </table>
 </form></div> 
<?cs /def ?>

<?cs def:print_content() ?>
<fieldset>
  <legend><?cs var:lang.super_roster_log_list.page_title ?></legend>
<table width="100%">
<tr><td align="center">
 <?cs call:print_log_files() ?>
</td></tr>
</table>
</fieldset>
<?cs /def ?>




<?cs def:print_detail() ?>
  <div style="text-align: left">
  <br />
  <table border="1" cellpading="2" cellspacing="0">
	   <?cs each:this = record ?>
	     <tr><td><?cs var:this.action ?></td></tr>
		 <?cs each:sub_action = this.sub ?>
		     <tr style="background: #cf9"><td><?cs var:sub_action.action ?></td></tr>
		 <?cs /each ?>
	   <?cs /each ?>
	   </table>
  </div>
<?cs /def ?>

<?cs def:print_delete_msg() ?>
<fieldset>
  <legend><?cs var:lang.super_roster_log_list.delete_title ?></legend>
    <form action="">
    <input type="button" onclick="closewin()" title="<?cs var:lang.super_roster_log_list.closewindow ?>" value="<?cs var:lang.super_roster_log_list.closewindow ?>" /></form>
</fieldset>
  
<?cs /def ?>

<?cs call:html_header() ?>
   <head>
      <title><?cs var:lang.super_roster_log_list.page_title ?></title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" href="<?cs var:image_path ?>super_template.css" type="text/css"  />
   <?cs if:delete ?>
     <script type="text/javascript">
       function closewin()
       {
	    opener.parent.location.reload();
	    window.close();
       }
     </script>
   <?cs /if ?>
  </head>
<body>
<div id="content">
 <?cs if:delete ?>
   <?cs call:print_delete_msg() ?>
 <?cs elif:show_detail ?>
 <div>
  <form><input type="button" value="<?cs var:lang.super_roster_log_list.closewindow ?>" title="<?cs var:lang.super_roster_log_list.closewindow ?>" onclick="window.close()" /> </form>
  </div>
 <?cs call:print_detail() ?>
     
   <?cs else ?>
 <div>
  <form><input type="button" value="<?cs var:lang.super_roster_log_list.closewindow ?>" title="<?cs var:lang.super_roster_log_list.closewindow ?>" onclick="window.close()" /> </form>
  </div>
   <?cs call:print_content() ?>
<?cs /if ?>
</div>
</body>
</html>
<?cs call:runtime() ?>
