<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/dateformat.tld" prefix="da" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  ~ This file is part of DebGen Biobank Software developed by ASTRID Research.
  ~ All rights reserved. Reproduction, modification, use or disclosure
  ~ to third parties without express authority is forbidden.
  ~
  ~ Copyright ASTRID Research Inc., Hungary, 2009-2011.
  ~
  ~ ASTRID Research
  ~ Headquaters: Csapo utca 42. Debrecen H-4029 HUNGARY
  ~ Phone: +36-52-533-173        Fax: +36-52-533-174
  ~ Web: http://www.astrid.hu    E-mail: info@astrid.hu
  ~
  ~ Project name: DebGen Biobank Software project.
  ~ URLS:
  ~ Developers: Istvan Zoltan Nagy (istvan.nagy@astrid.hu)
  --%>

<script type="text/javascript">
    setWebTitle('<fmt:message key="BIOBANK_BETEGEK" />');
    autocompleteOff();
</script>
<form id="showPatient" action="showpatient.html" method="get">
    <input id="patientId" type="hidden" name="patient" value="">
</form>
<div class="window" style="width: 600px; margin-left: -300px;">
    <div class="title"><fmt:message key="BIOBANK_BETEGEK" /></div>
    <table border="0" cellspacing="10" cellpadding="5">
        <tbody>
            <tr>
                <td class="patientheader" ></td>
                <td><fmt:message key="BIOBANK_BETEGEK" /></td>
        </tr>
        </tbody>
    </table>
    <div class="content">
        <div style="padding: 10px;">
            <c:if test="${site eq 'searchpatient.html'}">
                <p><fmt:message key="searchResult" /></p>
                <p>
                <!--< c : if test="$ {user.dataRecorder}">
                    <fmt:message key="BETEG_NEV" />: $ {pattern.identity.patientName}<br />
                    <fmt:message key="TAJ" />: $ {pattern.identity.tajNumber}<br />
                </ c : if> -->
                <fmt:message key="KRITERIUMOK" />: ${pattern.identity.patientName}</p>
            </c:if>
	    <c:if test="${site ne 'searchpatient.html'}">
                <div style="width: 97%" align="right"><a href="findpatient.html"><fmt:message key="KERES" /></a></div>
            </c:if>
	    <c:if test="${not empty patients}">
                <div style="width: 576px;" class="patientline">
                    <fmt:message key="pageSelector" />
                </div>
                <%@include file="../pageselector.jsp" %>
                <br />
            </c:if>
            <c:if test="${user.dataRecorder}">
                <fmt:message key="KATTINTSON" /> <a href="createpatient.html"><fmt:message key="IDE" /></a> <fmt:message key="ÚJ_BETEG_HOZZÁADÁSÁHOZ." /><br />
            </c:if>
            <c:if test="${not empty patients}">
                <table border="0" width="576" cellspacing="5" cellpadding="0">
                    <tbody>
                        <tr>
                            <td align="center" width="75"><a href="${site}?page=0&size=${size}${refind}&orderBy=patientCode&asc=${asc eq 'false' or order ne 'patientCode' ? 'true' : 'false'}"><fmt:message key="patientCode" /></a></td>
                    <c:if test="${user.dataRecorder}">
                        <td align="center" width="150"><a href="${site}?page=0&size=${size}${refind}&orderBy=patientNameMonogram&asc=${asc eq 'false' or order ne 'patientNameMonogram' ? 'true' : 'false'}"><fmt:message key="patientNameMonogram" /></a></td>
                        <td align="center" width="76"><a href="${site}?page=0&size=${size}${refind}&orderBy=taj&asc=${asc eq 'false' or order ne 'taj' ? 'true' : 'false'}"><fmt:message key="TAJ" /></a></td>
                    </c:if>
                    <c:if test="${user.researcher and not user.dataRecorder}">
                        <td align="center" width="150"><a href="${site}?page=0&size=${size}${refind}&orderBy=monogram&asc=${asc eq 'false' or order ne 'monogram' ? 'true' : 'false'}"><fmt:message key="monogram" /></a></td>
                    </c:if>
                    <c:if test="${user.dataRecorder}">
                    <td align="center" width="125"><a href="${site}?page=0&size=${size}${refind}&orderBy=dateOfBirth&asc=${asc eq 'false' or order ne 'dateOfBirth' ? 'true' : 'false'}"><fmt:message key="dateOfBirth" /></a></td>
                    </c:if>
                    </tr>
                    </tbody>
                </table>
                <c:forEach items="${patients}" var="p">
                    <div class="inactivesmallmenu" onmousemove="className='activesmallmenu';" onmouseout="className='inactivesmallmenu';" onclick="document.getElementById('patientId').value = ${p.id}; document.getElementById('showPatient').submit(); " >
                        <table border="0" width="576" cellspacing="5" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td width="75">${p.patientCode}</td>
                            <c:if test="${user.dataRecorder}">
                                <td width="150">${p.named ? p.identity.patientName : p.anonymousData.monogram}</td>
                                <td width="76">${p.named ? p.identity.tajNumber : '-'}</td>
                            </c:if>
                            <c:if test="${user.researcher and not user.dataRecorder}">
                                <td width="150">${p.anonymousData.monogram}</td>
                            </c:if>
                            <c:if test="${user.dataRecorder}">
                            <td align="center" width="125">${p.dateOfBirthForWeb}</td>
                            </c:if>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </c:forEach>
                <div style="width: 576px;" class="patientline">
                    <fmt:message key="pageSelector" />
                </div>
                <%@include file="../pageselector.jsp" %>
            </c:if>
            <c:if test="${empty patients}">
                    <br />
                    <fmt:message key="emptyList" />
                    <br />
                    <br />
            </c:if>
        </div>
    </div>
        <div class="copyright">
            &copy; 2009-2010 Astrid Research Inc.
        </div>
</div>
