<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
	"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
    <title></title>
    <style type="text/css">
        <!--/* <![CDATA[ */
            table { border-collapse: collapse; margin-left: 1em; }
            thead tr { background-color: ActiveCaption; color: CaptionText; }
            th, td { vertical-align: top; font-size: 9pt; padding: 5px;
                font-family: "Tahoma", Arial, Helvetica, sans-serif; }
            td { border: 1px solid #c0c0c0; } /* silver */
            thead .col2 { width: 200px; }
            h3 { border-bottom: dotted 1px #000 }
        /* ]]> */-->
    </style>
</head>
    [% USE Dumper %]
<body>
    <h3>Cases registered on HILIS and error rate by UserID for
        [% ref_date.month_name; ' '; ref_date.year %]:</h3>

    <table>
        <thead>
            <tr>
                <th>User</th>
				<th>Total</th>
				<th colspan="2">Freq (%)</th>
            </tr>
        </thead>
        [% FOREACH row IN users; # Dumper.dump(row); %]
        <tr>
            [% FOREACH col IN row; # Dumper.dump(col); %]
                <td>[% col %]</td>
            [% END %]
        </tr>
        [% END %]
    </table>

    <h3>Error code frequencies for [% ref_date.month_name ? 'month' : 'year' %]
        [total requests = [% total %]]:</h3>

    <table>
        <thead>
            <tr>
				<th colspan="2">Error code</th>
				<th>n</th>
				<th>%</th>
            </tr>
        </thead>
        [% FOREACH row IN errs; # Dumper.dump(row); %]
        <tr>
            [% FOREACH col IN row; # Dumper.dump(col); %]
                <td>[% col %]</td>
            [% END %]
			<td>[% 100 * col.last / total | format('%.2f') %]</td>
        </tr>
        [% END %]
    </table>
</body>
</html>
