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

<?cs def:print_time(time) ?>
     <?cs set:number = #0 ?>
     <?cs if:time[0] ?>
     <?cs each:mytime = time ?>
      <td align="center"><?cs var:mytime ?></td>
     <?cs set:number = number + #1 ?>
     <?cs /each ?>
    <?cs /if ?>
     <?cs loop:x = #10 - number, #1, "-1" ?>
      <td align="center">&nbsp;</td>
     <?cs /loop ?>
<?cs /def ?>

<?cs def:print_row(person, help) ?>
 <tr>
    <td align="center">
        <?cs var:person.id ?><br />
        <a href="<?cs var:person.url ?>" title="<?cs var:help ?> <?cs var:person.realname ?>" ><?cs var:person.realname ?></a>
    </td>
    <td align="center"><?cs var:person.unread_msg_count ?></td>
    <td align="center"><?cs var:person.logincount ?></td>
    <?cs call:print_time(person.times) ?>
 </tr>
<?cs /def ?>


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
   <head>
      <title><?cs var:lang.stats_recent_logins.title ?> <?cs var:current_time ?></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>
<body>
<?cs call:course_info() ?>
    <div>
    <a href="<?cs var:back_url ?>" title="<?cs var:lang.stats_recent_logins.goback ?>"><img src="<?cs var:image_path ?>/back_arrow.gif" width="50" height="34" alt="<?cs var:lang.stats_recent_logins.goback ?>" /></a>
  </div> 
  <div class="center_msg">
   <span class="alert_color"><?cs var:lang.stats_recent_logins.title ?> <?cs var:current_time ?></span>
  </div>
<table width="100%">
<tr><td align="center">
   <table cellspacing="0" cellpadding="4" border="1">
   <tr class="table_heading">
     <?cs set:cols = #0 ?>
     <?cs each:this = lang.stats_recent_logins.heading ?>
       <?cs if:cols == 3 ?>
         <th colspan="10"><?cs var:this ?></th>
      <?cs else ?>
       <th><?cs var:this ?></th>
      <?cs /if ?>
       <?cs set:cols = cols + #1 ?>
     <?cs /each ?>
   </tr>
   <?cs each:person = logins ?>
    <?cs call:print_row(person, lang.stats_recent_logins.url.help) ?>
   <?cs /each ?>
   </table>
</td></tr>
</table>
</body>
</html>
<!-- <?cs var:runtime ?> -->
