   <%@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 Organizations">
<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="text11n">
					<h:form>


				<div class="title14bb"><strong><h:outputText value="Search registered organizations" ></h:outputText></strong></div>
						
						
						
							
							<h:panelGrid border="1" columns="2" styleClass="gridstyle"
							style="width: 470px">
							
								<h:panelGrid border="0" columns="2" styleClass="gridstyle"
							style="width: 250px">
								<h:selectOneRadio styleClass="gridstyle" layout="pageDirection" value="#{organizationmanager.searchcc}" >
									<f:selectItem itemLabel=" " itemValue="0"/>
									<f:selectItem itemLabel=" " itemValue="1"/>
								</h:selectOneRadio>
												<h:panelGrid border="0" columns="2" styleClass="gridstyle"
							style="width: 220px">
							<h:outputText value="All organizations"></h:outputText>
							<h:outputText value=""></h:outputText>
							<h:outputText value="By name:"></h:outputText>
							<h:inputText styleClass="textboxstyle"
								style="width: 100px" value="#{organizationmanager.szsearchname}"></h:inputText>
							</h:panelGrid>
											</h:panelGrid>
											
								<h:panelGrid border="0" columns="2" styleClass="gridstyle"
								style="width: 300px">
								<h:outputText value=""></h:outputText>
								<h:panelGrid border="0" columns="2" styleClass="gridstyle"
								style="width: 250px">
									<h:outputText value="Sort By"></h:outputText>
									<h:selectOneMenu value="#{organizationmanager.sort}">
										<f:selectItem itemLabel="Name" itemValue="0"/>
											<f:selectItem itemLabel="Country" itemValue="1"/>
											<f:selectItem itemLabel="TaxNumber" itemValue="2"/>
										</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 organizations" ></h:outputText></strong></div>
							<h:outputText value="The following list contains all organizations that meet your search criteria" ></h:outputText><br><br/>
					
                                         
                                                         
                                                         <h:dataTable id="peoplelista" value="#{organizationmanager.aorg}" 
		binding="#{organizationmanager.orgdata}" var="orgsdatasets" 
		style="width: 524px" border="1"
		columnClasses="none, checkBoxStyle"
		rowClasses="gridstyle"
		headerClass="gridstyle"
                
>
			
			
                         <h:column id="ID">
			<f:facet name="header">
                             
                             
                    <h:outputText value="ID" />
           
                
      			
    		</f:facet>
				<h:outputText value="#{orgsdatasets.id}"/>
			</h:column> 
                         
			<h:column id="Name">
			<f:facet name="header">
      			     
                    <h:outputText value="Name" />
               
    		</f:facet>
				<h:outputText value="#{orgsdatasets.organizationname}"/>
			</h:column> 
                         
                         <h:column id="country">
			<f:facet name="header">
      			<h:outputText  value="country"/>
    		</f:facet>
				<h:outputText value="#{orgsdatasets.country}"/>
			</h:column> 
                         
		  <h:column id="taxnumber">
			<f:facet name="header">
      			<h:outputText  value="taxnumber"/>
    		</f:facet>
				<h:outputText value="#{orgsdatasets.taxnumber}"/>
			</h:column> 	
			
			
		 <h:column id="view">
			<f:facet name="header">
      			<h:outputText  value="view"/>
    		</f:facet>
<h:commandLink id="viewuserdetails" styleClass="link" immediate="true" action="#{organizationmanager.view}">
                        <h:outputText value="View"/>
                      <f:param name="id" value="#{orgsdatasets.id}"/>
              </h:commandLink>

			</h:column> 	
                         
                <h:column id="edit">
			<f:facet name="header">
      			<h:outputText  value="edit"/>
    		</f:facet>
				<h:commandLink id="edituserdetails" styleClass="link" immediate="true" action="#{organizationmanager.edit}">
                        <h:outputText value="Edit"/>
                      <f:param name="id" value="#{orgsdatasets.id}"/>
              </h:commandLink>
                                 
                                  			</h:column> 	
                         
                          <h:column id="delete">
			<f:facet name="header">
      			<h:outputText  value="delete"/>
    		</f:facet>
				<h:commandLink id="deleteuserdetails" styleClass="link" immediate="true" action="#{organizationmanager.delete}">
                        <h:outputText value="Delete"/>
                      <f:param name="id" value="#{orgsdatasets.id}"/>
              </h:commandLink>
			</h:column> 	
               
		</h:dataTable>

                                                         
                                                         
                                                         
                                                         
							<h:outputText value="To add a new organization click on the button below" ></h:outputText>
							<br></br>
							<h:commandButton id="orgadd"
											value="Create new organization" 
											styleClass="buttonstyle"
											action="orgadd"
											/>	
                                                                                        
  

												</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>