<%@ include file="/includes.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<style>
.arialStyle {
	font: arial;
}
</style>
<html>
<head>
<title>Referral Users Statistics Report</title>
	<link rel="icon" href="../../images/emdt.ico" type="image/x-icon" >
	<link rel="shortcut icon" href="../../images/emdt.ico" type="image/x-icon" >
	<link rel="stylesheet" href="../referrals/css/reports.css" type="text/css"
		media="screen, print">
	
	<style media="print" type="text/css">
	.noPrint {
		visibility: hidden;
		display: none;
	}
	</style>
</head>
<body>


<c:choose>
	<c:when
		test="${(referralsUserReport ne null) and (fn:length(referralsUserReport) ne 0)}">
		<h2>Referrals Users Statistics Summary between
				<c:out value="${startDate}"/> - <c:out value="${endDate}"/></h2>
		<br />
		
		<table border="1" class="report">
			<tr align="center" style="height: 50px">
				<th style="width: 160px">User</th>
				<th>No. of Logins</th>
				<th>No. of Patients Referred</th>
				<th>No. of Patients Viewed</th>
				<th>No. Responses sent</th>
				<th>No. of Complete Referrals Viewed</th>

			</tr>

			<c:forEach var="report" items="${referralsUserReport}"
				varStatus="line">
				<tr>
					<td align="center">&nbsp;<c:out value="${report.userName}"/></td>

					<td align="center">&nbsp;<c:out value="${report.numTimesLogged}"/></td>

					<td align="center">&nbsp;<c:out value="${report.numPatientsRef}"/></td>

					<td align="center">&nbsp;<c:out value="${report.numPatientsViewed}"/></td>

					<td align="center">&nbsp;<c:out value="${report.numRespSent}"/></td>

					<td align="center">&nbsp;<c:out value="${report.numRefCompleted}"/></td>

				</tr>
			</c:forEach>

			<tr>
				<th align="right">Totals:</th>
				<td align="center">&nbsp;<c:out value="${totalSignIn}"/></td>
				<td align="center">&nbsp;<c:out value="${totalPatientReferred}"/></td>
				<td align="center">&nbsp;<c:out value="${totalPatientViewed}"/></td>
				<td align="center">&nbsp;<c:out value="${totalResponseSent}"/></td>
				<td align="center">&nbsp;<c:out value="${toatlCompleteReferralsViewed}"/></td>
			</tr>
		</table>
		<br />
		<table border="1" class="report">
			<tr>
				<td style="width: 160px">Total Number of
				Users</td>
				<td style="width: 164px" align="center"><c:out value="${totalNumberOfUsers}"/></td>
			</tr>
		</table>
		<br />
	</c:when>
	<c:otherwise>
		<div><b><u>Referrals Users Statistics
		Summary For <c:out value="${startDate}"/> To <c:out value="${endDate}"/></u></b></div>
		<br />
		<br />
		<br />
		<div><b>There is no Referrals Users
		Report for given date range.</b></div>

	</c:otherwise>
</c:choose>

<br />

<div id="navigation"  class="navButtonBar noPrint">
	
	<%String str1 = (String)request.getAttribute("module");%>
	<c:set var="str" value="<%=str1%>"/>

	<c:choose>
		<c:when test="${str eq 'referral'}">
			<img src="../images/16x16/arrow_undo.png" />&nbsp;Back to: <a href="../referrals/referralsReportMenu.jsp">Reports main menu</a> &nbsp; &gt; &nbsp;<a href="../referrals/referralsUserReportStats.jsp?module=referral" class="noPrint"> This report settings</a>
		</c:when>
		<c:otherwise>
			<a href="../emdt/referralsUsersReport.jsp" class="noPrint"><img src="../images/16x16/arrow_undo.png" />&nbsp;&nbsp;Return to previous screen</a>
		</c:otherwise>
	</c:choose>

	&nbsp; &nbsp; &nbsp;
	
	<a href="javascript:print();"><img border="0" alt="Printer icon" src="../images/16x16/printer.png"> Print</a>

	&nbsp; &nbsp; &nbsp;
	
</div>



</body>
</html>