<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/spring" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div id="main">
    <table class="infotable" border="1" cellpadding="5">
        <tr>
            <th class="main_header"><spring:message code="informations.lastsendingdate"/></th>
            <th class="main_header"><spring:message code="informations.nextpossiblesendingdate"/></th>
        </tr>
        <tr>
            <td>
                <c:choose>
                    <c:when test="${timeRestriction.lastSendDate != null}">
                        <fmt:formatDate value="${timeRestriction.lastSendDate}" type="both" dateStyle="short" timeStyle="short"/>
                    </c:when>
                    <c:otherwise><c:out value="-"/></c:otherwise>
                </c:choose>
            </td>
            <td>
                <c:choose>
                    <c:when test="${timeRestriction.nextPossibleSendDate < timeRestriction.now}">
                        <c:out value="-"/>
                    </c:when>
                    <c:otherwise>
                        <fmt:formatDate value="${timeRestriction.nextPossibleSendDate}" type="both" dateStyle="short" timeStyle="short"/>
                    </c:otherwise>
                </c:choose>        
            </td>
        </tr>
    </table>
    
    <table class="infotable" border="1" cellpadding="5">
        <tr>
            <th colspan="5" class="main_header"><spring:message code="informations.databases"/></th>
        </tr>
        <tr>
            <th>#</th>
            <th><spring:message code="informations.database"/></th>
            <th><spring:message code="informations.addresses"/></th>
            <th><spring:message code="informations.duplicates"/></th>
            <th><spring:message code="informations.nonvalid"/></th>
        </tr>
        <c:forEach items="${databaseInformationList}" var="databaseInformation">
            <tr>
                <td><input type="checkbox"/></td>
                <td><c:out value="${databaseInformation.databaseName}"/></td>
                <td><c:out value="${databaseInformation.emailCount}"/></td>
                <td><c:out value="${databaseInformation.duplicates}"/></td>
                <td><c:out value="${databaseInformation.wrongEmails}"/></td>
            </tr>
        </c:forEach>
    </table>
    
    <script type="text/javascript">
        procesTableUpdater();
    </script>
    
    <div id="procestable">
        <jsp:include page="procestable.jsp"/>
    </div>
</div>
