<%@ 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">
<html-el:form action="/serviceUser" method="post">
  <%@ include file="/admin/csrfgentoken.jsp" %>
  <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.eeService.User.mainHeader"/></td>
                <td width="100%"></td>
                 <td nowrap class="moduleBlueLink" style="padding: 1px 8px 1px 8px"><fw:link action="/serviceUser.do?methodName=displayNew"><bean-el:message
            key="text.serviceUserNew"/></fw:link></td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>
    	    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="moduleShellTableBody">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <c:choose>
				<c:when test="${serviceUsers == null}">
					  <tr>
						<td class="moduleLabel" style="text-align: left; padding-left: 20"><bean-el:message key="message.serviceUsers.none"/></td>
					  </tr>
				</c:when>
				<c:otherwise>					
					<tr>
						<td class="moduleLabel" style="text-align: left; padding-left: 20"><bean-el:message key="message.eeServiceUsers.instructions"/></td>
					</tr>
	  
					<tr><td>&nbsp;</td></tr>				
				            
	
            <c:set var="rowColor" value="darkValue" />            
            
			<tr><td class="value">
			<table summary="Table for managing E and E Service User Accounts" width="100%">
				<thead>
					<tr>
						<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.eeServiceUsers.header.username"/></th>
						<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.eeServiceUsers.header.contactName"/></th>
						<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.eeServiceUsers.header.phone"/></th>
						<th scope="col" style="text-align:left; padding: 7 0 7 5" class="darkLabel"><bean-el:message key="label.eeServiceUsers.header.active"/></th>																		
					</tr>
				</thead>
    	      <tbody>
    	     		<c:set var="rowColor" value="darkValue" />
							<c:forEach var="serviceUser" items="${serviceUsers}">
							      <c:set var="userName" value="${serviceUser.userName}"/>
                   				  <c:set var="contactName" value="${serviceUser.userName}"/>
                   				  <c:set var="phone" value="${serviceUser.userName}"/>
                   				   <c:set var="active" value="${serviceUser.active}"/>
                   				  <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>
										<fw:link action="serviceUser.do?methodName=display&amp;userId=${serviceUser.entityKey.keyValue}">
												<esrcore:displayValue name="serviceUser" property="userName"/>						
											</fw:link> 						
									</td>
										<td width="20%" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
											<esrcore:displayValue name="serviceUser" property="contactName" />
										</td>
										<td width="20%" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
											<esrcore:displayValue name="serviceUser" property="contactPhone"/>							
										</td>
										<td width="18%" align="left" valign="top" class="<c:out value="${rowColor}"/>" nowrap>
											<esrcore:displayValue name="serviceUser" property="active" />
										</td>
									</tr>										
								</c:forEach>
				</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>

