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

<?cs def:print_list(data) ?>
<table width="100%">
 <tr><td align="center">
 <br /><br />
 <fieldset style="width: 50%">
 <legend class="fieldset_legend">
   <?cs if:show_list == 1 ?>
   <?cs var:data.title2 ?>
   <?cs else ?>
   <?cs var:data.title ?>
   <?cs /if ?>
 </legend>
  <div><form method="post" action="stats_ind_calendar" onsubmit="return validate_form()" >
   <div>
     <input type="hidden" name="id" value="<?cs var:id ?>" />
     <input type="hidden" name="crs" value="<?cs var:crs ?>" />
     <input type="hidden" name="list" value="<?cs var:show_list ?>" />
     <input type="hidden" name="prog" value="stats_calendar_select" />
   </div>
  <table cellspacing="0" cellpadding="4">
   <tr><td><select name="username" id="username" size="10" title="<?cs var:data.select.help ?>">
    <?cs each:this = user ?>
     <option value="<?cs var:this.value ?>"><?cs var:this.realname ?></option>
    <?cs /each ?>
    </select></td>
    <td valign="middle" class="regheading" align="center">
     <?cs var:data.check[0] ?><br />
      <input type="submit" name="oper" value="<?cs var:data.check[1] ?>" title="<?cs var:data.check[3] ?>" /><br />
      <?cs var:data.check[2] ?>
    </td>
   </tr>
  </table> 
  </form></div>
</fieldset>
 </td></tr>
</table>
<?cs /def ?>

<?cs call:html_heading() ?>
   <head>
      <?cs if:show_list == 1 ?>
      <title><?cs var:lang.stats_calendar_select.title2 ?></title>
      <?cs else ?>
      <title><?cs var:lang.stats_calendar_select.title ?></title>
      <?cs /if ?>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css"  />
  <script type="text/javascript">
   function validate_form()
   {
      var index = document.getElementById('username').selectedIndex;
      if(index < 0)
      {
         window.alert('<?cs var:lang.stats_calendar_select.select_user_warn ?>');  
         return false;
      }
      return true;
   }
  </script>
  </head>
<?cs call:define_body() ?>
<?cs call:print_course_heading(back_url, lang.stats_calendar_select.goback) ?>
 <?cs call:print_list(lang.stats_calendar_select) ?>
</body>
</html>
<?cs call:runtime() ?>
