<%@ 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" %> 
<%@ page import='gov.va.med.esr.common.model.comms.HandbookBatchStatistics' %>
<%
String[] headers = {"recordsSent handbooks", "recordsSent PfInserts", "recordsSent beneInserts","mailed","available",
        "handbooksStored","benefits","rejected", "code1Reject","returned"};
pageContext.setAttribute("headers", headers);
%>

<c:set var="countCols"><%= HandbookBatchStatistics.HB_SENT_TO_CMS %>,<%= HandbookBatchStatistics.PF_INSERT_SENT_TO_CMS %>,<%= HandbookBatchStatistics.BENEFITS_INSERT_SENT_TO_CMS %>,<%= HandbookBatchStatistics.MAILED_BY_CMS %>,<%= HandbookBatchStatistics.ONLINE %>,<%= HandbookBatchStatistics.HB_IN_VBR %>,<%= HandbookBatchStatistics.BAG_IN_VBR %>,<%= HandbookBatchStatistics.ERRORED_BY_CMS %>,<%= HandbookBatchStatistics.CODE_1_REJECT %>,<%= HandbookBatchStatistics.RETURNED_BY_USPS %></c:set>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell" role="presentation">
<html-el:form action="/handBookBatchFileProcess" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>
  <tr>
    <td>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable" role="presentation">
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead" role="presentation">
              <tr>
	            <td class="moduleBlueBox">&nbsp;</td>
                <td class="moduleHeadline" nowrap><bean-el:message key="handBookBatchFileStatistics.text.title"/></td>
                <td width="100%"></td>
               </tr>
            </table>
          </td>
        </tr>
        <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead" role="presentation">
              <tr>
                 <td class="moduleBrownBox"><img alt=""  src="../images/spacer.gif" width="29" height="1"/></td>
                  <td width="100%"><img alt=""  src="../images/spacer.gif"></td>
                <td nowrap class="moduleBlueLink" style="padding: 20 8 1 8"><html-el:link action="handBookBatchFileProcess?methodName=displayHandbookFileDateFilter"><bean-el:message key="link.button.handbookFileDateFilters"/></html-el:link></td>
					<td><img alt=""  src="../images/spacer.gif" width="5"/>
                  </td>
              </tr>
            </table>
          </td>
        <tr>
          <td>
    	    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody" role="presentation">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <c:choose>
				<c:when test="${handBookBatchFileProcessStat == null}">
					  <tr>
						<td class="moduleLabel" style="text-align: left; padding-left: 20"><bean-el:message key="message.handBookBatchRequests.none"/></td>
					  </tr>
				</c:when>
				<c:otherwise>					
	 
					<tr><td>&nbsp;</td></tr>				
				            
	
            <c:set var="rowColor" value="darkValue" />            
            
			<tr><td class="value">
<!-- CodeCR13201- 508 - Use header-id method to mark up column and row header cells- Table structure has been changed from complex to a simple data table for 508 compliance -->
			<table summary="Table for Hand Book Batch File Statistics"  width="100%">
				<thead>
					<tr>				
                    										
					    <th  style="text-align:left; padding: 7 0 7 5" id="bfDate" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.batchFileDate"/></th>
						<th  style="text-align:left; padding: 7 0 7 5" id="numRequests" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfBatchRequests"/></th>
						<th   style="text-align:left; padding: 7 0 7 5" id="originated" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordFromBatchRequest"/></th>																		
					    
					   
					    <th  style="text-align:left; padding: 7 0 7 5" id="handbooks" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordHandbook"/><div class="darklabelsmallerfont"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordSentToCMS"/></div></th>																		
					    <th  style="text-align:left; padding: 7 0 7 5" id="PfInserts" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordPFInserts"/><div class="darklabelsmallerfont"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordSentToCMS"/></div></th>																		
					   <th  style="text-align:left; padding: 7 0 7 5" id="beneInserts" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordBenefitsInserts"/><div class="darklabelsmallerfont"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordSentToCMS"/></div></th>	
					  
					  <th  style="text-align:left; padding: 7 0 7 5" id="mailed" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordMailedByCMS"/></th>		
					    <th   style="text-align:left; padding: 7 0 7 5" id="available" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfRecordOnline"/></th>																		
					    <th   style="text-align:left; padding: 7 0 7 5" id="handbooksStored" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfHandbooksInVBR"/></th>
					    <th  style="text-align:left; padding: 7 0 7 5" id="benefits" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfBAGInVBR"/></th>
					    <th  style="text-align:left; padding: 7 0 7 5" id="rejected" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfErroredbyCMS"/></th>
					    <th  style="text-align:left; padding: 7 0 7 5" id="code1Reject" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfCode1Reject"/></th>
					    <th  style="text-align:left; padding: 7 0 7 5" id="returned" class="darkLabel"><bean-el:message key="label.handBookBatchFileStatistics.header.noOfReturnedbyUSPS"/></th>
					</tr>
					
				</thead>
    	      <tbody>
                	<c:set var="rowColor" value="darkValue" />
						<c:set var="counts" value="${handBookBatchFileProcessStat.counts}"/>
                           <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  headers="bfDate" width="7%" align="left" valign="top" class="<c:out value="${rowColor}"/>" >
											<esrcore:displayValue name="handBookBatchFileProcessStat" property="fileProcessBatchStartDateStr" />
									</td>
            
                                    <td width="7%" headers="numRequests" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
                                            <esrcore:displayValue name="handBookBatchFileProcessStat" property="numFileBatchRequest"/>                          
                                    </td>   
									<td width="7%" headers="originated" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
											<esrcore:displayValue name="handBookBatchFileProcessStat" property="numRecordsFromFileBatchRequest"/>							
									</td>										
					
									<c:forEach var="countColIndex" items="${countCols}" varStatus="status">
											<td width="7%" headers="<c:out value='${headers[status.index]}'/>" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
												<c:out value="${counts[countColIndex]}"/>							
											</td>
									</c:forEach>
				
							</tr>										
							
				</tbody>
			 </table>
			 
			 
			</td></tr>
			  
			  </c:otherwise>
			</c:choose>
			  <tr>
                <td>&nbsp;</td>
              </tr>                            
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</html-el:form>
</table>



