<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="/tags/fw" prefix="fw" %> 

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell">
  <tr>
    <td>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable">
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead">
              <tr>
	            <td class="moduleBlueBox">&nbsp;</td>
                <td class="moduleHeadline" nowrap><bean-el:message key="label.batchProcessManagement.mainHeader"/></td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>
    	    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td class="moduleLabel" style="text-align: left; padding-left: 20"><bean-el:message key="message.batchProcessHistory.instructions"/></td>
              </tr>
			  <tr>
                <td>&nbsp;</td>
              </tr>              
	            
			<tr><td class="value"><jsp:include page="batchProcessDetail.jsp" flush="true"/></td></tr>				

			<tr><td>&nbsp;</td></tr>				
				
			<c:if test="${jobResults != null}">
				<tr>
					<td>
						<table summary="History table for the selected batch process">
						<thead>
							<tr>
								<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.batchProcessResult.startDate"/></th>
								<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.batchProcessResult.endDate"/></th>
								<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.batchProcessResult.runBy"/></th>
								<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.batchProcessResult.status"/></th>
								<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.batchProcessResult.statistics"/></th>				
							</tr>
						</thead>
						<c:set var="rowColor" value="darkValue" />
						<tbody>
						<c:forEach var="jobResult" items="${jobResults}">
							<c:choose>
								<c:when test="${rowColor == 'darkValue'}">
									<c:set var="rowColor" value="value" />
								</c:when>
								<c:otherwise>
									<c:set var="rowColor" value="darkValue" />
								</c:otherwise>
							</c:choose>
			
							 <tr>				
									<td scope="row" width="20%" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
										<esrcore:displayDate name="jobResult" dateProperty="startDate" displayTime="true"/>
									</td>
									<td headers="r${loop.index} c2" width="20%" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
										<esrcore:displayDate name="jobResult" dateProperty="endDate" displayTime="true"/>
									</td>
									<td headers="r${loop.index} c3" width="20%" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
										<esrcore:displayValue name="jobResult" property="context"/>							
									</td>
									<td headers="r${loop.index} c4" width="20%" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
										<esrcore:displayValue name="jobResult" property="status"/>							
									</td>
									<td headers="r${loop.index} c5" width="20%" align="left" valign="top" class="<c:out value="${rowColor}"/>">
										<esrcore:displayValue name="jobResult" property="statistics"/>							
									</td>
								</tr>										
							</c:forEach>
							</tbody>
						</table>
					</td>
				</tr>
			</c:if>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>

