   <%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="org.ellectra.gui.utils.JSFUtils"%>
<%@page import="javax.faces.context.FacesContext"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>

<f:view>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    
    %>

<base href="<%=basePath%>">
<title>Admin Console</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="Search Users">
<link rel="stylesheet" href="commission.css" type="text/css">
<link rel="stylesheet" href="ellectraweb.css" type="text/css">

</head>
<body>
<a name="top"></a>

<div align="center">

<table border="0" cellspacing="0" cellpadding="0" width="760"
	class="tbl1" summary="Container of page content">

	
	<!-- HEADER LINE -->
	<%@ include file="/header.jsp"%>
	</td>
</tr>
<tr>
	<td bgcolor="#ffffff" height="1"></td>
</tr>
<tr>
	<td bgcolor="#330099" height="1"></td>
</tr><!-- END OF HEADER -->

	<!-- MAIN CONTENT -->
	<tr>
		<td valign="top" align="left">
		<table border="0" cellspacing="0" cellpadding="0" width="760"
			height="450" bgcolor="#FFFFFF" id="content" summary="Content of page">
			<tr>
				<!-- MENU CELL -->
				<%@ include file="/navigation-menu.jsp"%>
				<!-- END OF MENU CELL -->

				<!-- VERTICAL SEPERATOR CELLS -->
				<td width="1" class="sep" height="100%"></td>
				<td width="15"></td>
<!-- CENTRAL CONTENT CELL -->
				<td width="565" valign="top">
				<br /> 
       <div class="title14bb">
                                        <strong><h:outputText value="Search registered users" ></h:outputText></strong>
                                    </div>
                                    <br>

                                        <div class="text11n">
                                        <h:form>
                                            
                                                <h:panelGrid border="1" columns="2" styleClass="gridstyle" style="width: 470px">
                                                    
                                                    <h:panelGrid border="0" columns="2">
                                                        <h:selectOneRadio styleClass="gridstyle" layout="pageDirection" value="#{usermanager.searchcc}">
                                                            <f:selectItem itemLabel=" " itemValue="0"/>
                                                            <f:selectItem itemLabel=" " itemValue="1"/>
                                                        </h:selectOneRadio>
                                                        <h:panelGrid border="0" columns="2">
                                                            <h:outputText value="All users"></h:outputText>
                                                            <h:outputText value=""></h:outputText>
                                                            <h:outputText value="By username:"></h:outputText>
                                                            <h:inputText styleClass="textboxstyle" style="width: 100px" value="#{usermanager.szsearchname}"></h:inputText>
                                                        </h:panelGrid>
                                                    </h:panelGrid>
                                                    
                                                    <h:panelGrid border="0" columns="2">
                                                        <h:outputText value=""></h:outputText>
                                                        <h:panelGrid border="0" columns="2">
                                                            <h:outputText value="Sort By"></h:outputText>
                                                            <h:selectOneMenu value="#{organizationmanager.sort}">
                                                                <f:selectItem itemLabel="Status" itemValue="0"/>
                                                                <f:selectItem itemLabel="UserName" itemValue="1"/>
                                                                <f:selectItem itemLabel="Organization" itemValue="2"/>
                                                                <f:selectItem itemLabel="Account Creation Date" itemValue="3"/>
                                                            </h:selectOneMenu>
                                                        </h:panelGrid>   
                                                    </h:panelGrid>
                                                    
                                                </h:panelGrid>
                                                
                                                <h:panelGrid border="0" columns="1" style="width: 470px">
                                                    <h:panelGroup>
                                                        <p align="right">
                                                            <h:commandButton id="searchcommand" value="Search" styleClass="buttonstyle" onclick="submit"/>
                                                        </p>
                                                    </h:panelGroup>
                                                </h:panelGrid>
                                                
               
               
                                                <div class="title14bb">
                                                    <strong><h:outputText value="List of registered users" ></h:outputText></strong>
                                                </div>
                                                <h:outputText value="The following list contains all the users that meet your search criteria" ></h:outputText><br><br/>
                                                
                                                
                                                
                                                <h:dataTable id="peoplelista" value="#{usermanager.auser}" 
                                                             binding="#{usermanager.userdata}" var="userdatasets" 
                                                             style="width: 524px" border="1"
                                                             columnClasses="none"
                                                             rowClasses="gridstyle"
                                                             headerClass="gridstyle">
                                                    
                                                    
                                                            <h:column id="ID">
                                                                <f:facet name="header">
                                                                    <h:outputText value="ID" />
                                                                </f:facet>
                                                                <h:outputText value="#{userdatasets.id}"/>
                                                            </h:column> 

                                                            <h:column id="userName">
                                                                <f:facet name="header">
                                                                    <h:outputText value="Username" />
                                                                </f:facet>
                                                                <h:outputText value="#{userdatasets.username}"/>
                                                            </h:column>
                                                            
                                                            <h:column id="Name">
                                                                <f:facet name="header">
                                                                    <h:outputText value="First Name" />
                                                                </f:facet>
                                                                <h:outputText value="#{userdatasets.name}"/>
                                                            </h:column> 
                                                    
                                                            <h:column id="surname">
                                                                <f:facet name="header">
                                                                    <h:outputText  value="Last Name"/>
                                                                </f:facet>
                                                                <h:outputText value="#{userdatasets.surname}"/>
                                                            </h:column> 

                                                            <h:column id="organization">
                                                                <f:facet name="header">
                                                                    <h:outputText  value="Organization"/>
                                                                </f:facet>
                                                                <h:outputText value="#{userdatasets.orgName}"/>
                                                            </h:column>
                                                    
                                                            <h:column id="userolesonsearch">
                                                              <f:facet name="header">
                                                                  <h:outputText  value="Roles"/>
                                                              </f:facet>
                                                              <h:outputText value="#{userdatasets.szuserrole}"/>
                                                          </h:column>
                                                    
                                                            <h:column id="status">
                                                                <f:facet name="header">
                                                                    <h:outputText  value="Status"/>
                                                                </f:facet>
                                                                <h:outputText value="#{userdatasets.status}"/>
                                                            </h:column>                         
                                                    
                                                            <h:column id="Operations">
                                                                <f:facet name="header">
                                                                    <h:outputText  value="Operations"/>
                                                                </f:facet>

                                                                <h:commandLink id="userops2" styleClass="link" immediate="true" action="#{usermanager.accept}">
                                                                    <h:outputText value="Accept"/>
                                                                    <f:param name="id" value="#{userdatasets.id}"/>
                                                                </h:commandLink>
                                                                <h:outputText value=" - "/>
                                                                <h:commandLink id="userops3" styleClass="link" immediate="true" action="#{usermanager.delete}">
                                                                    <h:outputText value="Delete"/>
                                                                    <f:param name="id" value="#{userdatasets.id}"/>
                                                                </h:commandLink>
                                                            </h:column> 	
                                                    
                                                </h:dataTable>
                                                
                                                
                                                <h:panelGrid border="0" columns="1" style="width: 524px">
                                                    <h:panelGroup>
                                                        <p align="right">
                                                        <h:commandButton  value="First Page"	styleClass="buttonstyle"/>
                                                        <h:commandButton  value="Previous Page"	styleClass="buttonstyle"/>
                                                        <h:commandButton  value="Next Page"	styleClass="buttonstyle"/>
                                                        <h:commandButton  value="Last Page"	styleClass="buttonstyle"/>
                                                    </h:panelGroup>
                                                </h:panelGrid>
                                                
                                            </h:form>
                                        </div>
                                    </td>
                                    <!-- END OF CENTRAL CONTENT CELL -->




<!-- VERTICAL SEPERATOR CELL -->
				<td width="14"></td>
			</tr>
		</table>
		</td>
	</tr>

	<%@ include file="/footer.jsp"%>
</table>
</div>
</body>

</html>

</f:view>