<%@ 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_MINTA_TÍPUSOK" />');
    autocompleteOff();

    function deleteSampleType(id) {
        show(id);
        if (confirm('<fmt:message key="torlesBiztos" />'))
            document.location.href = 'deletesampletype.html?sample='+id;
    }

    function showNew() {
        show('new');
    }

    function show(id) {
        if (document.getElementById(id+'edit').style.display == 'none') {
            document.getElementById(id+'edit').style.display = 'block';
            document.getElementById(id+'show').style.display = 'none';
        } else {
            document.getElementById(id+'show').style.display = 'block';
            document.getElementById(id+'edit').style.display = 'none';
        }
    }
</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_MINTA_TÍPUSOK" /></div>
    <table border="0" cellspacing="10" cellpadding="5">
        <tbody>
            <tr>
                <td class="labheader" ></td>
                <td><fmt:message key="BIOBANK_MINTA_TÍPUSOK" /></td>
        </tr>
        </tbody>
    </table>
    <div class="content">
        <div style="padding: 10px;">
            <div style="padding-left: 10px; padding-right: 10px;">
                <c:set var="informationString"><fmt:message key="${info}"/></c:set>
                <c:if test="${not empty info}"><%@include file="../showembededinformation.jsp" %></c:if>
                <%@include file="../showembedederror.jsp" %>
                <br />
            </div>
            <div id="newshow" style="display: ${not empty sample and empty info ? 'none' : 'block'}">
                <fmt:message key="KATTINTSON" /> <a href="javascript:showNew();"><fmt:message key="IDE" /></a> <fmt:message key="NEW_SAMPLETYPE" /><br />
            </div>
            <div id="newedit" style="display: ${not empty sample and empty info ? 'block' : 'none'}; text-align: center;">
                <form style="margin: 0px; padding: 0px; vertical-align: bottom;" name="sample" action="savesampletype.html" method="POST">
                    <input type="hidden" name="id" value="" />
                    <input class="shortinputrequired" type="text" name="oneLetterCode" value="${empty info ? sample.oneLetterCode : ''}" maxlength="1" style="width: 20px; vertical-align: bottom;" />
                    <input class="shortinputrequired" type="text" name="sampleCategoryName" value="${empty info ? sample.sampleCategoryName : ''}" maxlength="100" style="width: 300px; vertical-align: bottom;" />
                    <input class="button" style="vertical-align: bottom;" type="submit" value="<fmt:message key="MENTÉS" />" name="save" />
                    <input class="button" style="vertical-align: bottom;" type="button" value="<fmt:message key="MÉGSE" />" name="cancel" onclick="javascript:showNew();" />
                </form>
            </div>
            <c:if test="${not empty samples}">
                <table border="0" width="576" cellspacing="5" cellpadding="0">
                    <tbody>
                        <tr>
                            <td align="center" width="75"><fmt:message key="oneLetterCode" /></td>
                    <td align="center" width="300"><fmt:message key="sampleTypeName" /></td>
                    <td align="center" width="100"><fmt:message key="actions" /></td>
                    </tr>
                    </tbody>
                </table>
                <c:forEach items="${samples}" var="s">
                    <div title="<fmt:message key="SZERKESZTÉS" />" id="${s.id}show" class="inactivesmallmenu" onmousemove="className='activesmallmenu';" onmouseout="className='inactivesmallmenu';" onclick="javascript:show(${s.id})" style="display: block;" >
                         <table border="0" width="576" cellspacing="5" cellpadding="0">
                            <tbody>
                                <tr>
                                    <td width="75" align="center">${s.oneLetterCode}</td>
                                    <td width="300">${s.sampleCategoryName}</td>
                                    <td class="button" align="center" valign="middle"
                                        style="width: 100px; height: 25px; background: url('pics/buttonbgr.png');"><a class="menulink" style="display: block; width: 100px; padding-top: 4px;" href="javascript:deleteSampleType(${s.id});"><fmt:message key="TORLES" /></a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div id="${s.id}edit" class="activesmallmenu" style="cursor: default; margin-top: 1px; margin-bottom: 1px; padding: 5px; display: none; text-align: center;">
                        <form style="margin: 0px; padding: 0px; vertical-align: bottom;" name="sample" action="savesampletype.html" method="POST">
                            <input type="hidden" name="id" value="${s.id}" />
                            <input class="shortinputrequired" type="text" name="oneLetterCode" value="${s.oneLetterCode}" maxlength="1" style="width: 20px; vertical-align: bottom;" />
                            <input class="shortinputrequired" type="text" name="sampleCategoryName" value="${s.sampleCategoryName}" maxlength="100" style="width: 300px; vertical-align: bottom;" />
                            <input class="button" style="vertical-align: bottom;" type="submit" value="<fmt:message key="MENTÉS" />" name="save" />
                                   <input class="button" style="vertical-align: bottom;" type="button" value="<fmt:message key="MÉGSE" />" name="cancel" onclick="javascript:show(${s.id});" />
                        </form>
                    </div>
                </c:forEach>
            </c:if>
            <c:if test="${empty samples}">
                <br />
                <fmt:message key="emptyList" />
                <br />
                <br />
            </c:if>
        </div>
    </div>
        <div class="copyright">
            &copy; 2009-2010 Astrid Research Inc.
        </div>
</div>
