<%@page contentType="text/html" session="true"%>
<jsp:useBean id="indexListBean" scope="application" 
	class="org.injac.indexing.beans.IndexListBean" />
<jsp:useBean id="selIndex" scope="session"
	class="java.lang.String" />	
<%@page import="java.util.Date"%>	
<table class="infos_index" border="0" bordercolor="black">
<thead><tr><th colspan="3">Informations sur l'index</th></tr></thead>
<tbody>
<%
	int index=-1;
	try {
		index =Integer.parseInt(request.getParameter("index"));
	}catch(Exception e){
		try{
			index =Integer.parseInt(selIndex);
		}catch(Exception e2){
			index = Integer.parseInt((String)request.getAttribute("index"));
		}
	}
	Date creationDate = new Date(indexListBean.getCreationDate(index));
	String creation =  creationDate.toLocaleString();
	Date modificationDate = new Date(indexListBean.getModificationDate(index));
	String modification =  modificationDate.toLocaleString();
	
%>

<tr><td class="desc">Nom de l'index : </td><td><%=indexListBean.getName(index) %></td></tr>
<tr><td class="desc">URL WEBDAV : </td><td><%=indexListBean.getURL(index)%></td></tr>
<tr><td class="desc">Login : </td><td><%=indexListBean.getLogin(index)%></td></tr>
<tr><td class="desc">M&eacute;tadonn&eacute;es : </td>
	<td>
<%
	String mode=indexListBean.getStringMode(index);
	
	out.println(mode);
%>	
	</td>
</tr>
<tr><td class="desc">Date de cr&eacute;ation : </td><td><%=creation%></td></tr>	
<% if(!modification.equals(creation)) { %>
<tr><td class="desc">Derni&egrave;re modification : </td><td><%=modification%></td></tr>	
<% } %>
</tbody>
</table>


<table class="infos_index">	
	<thead><tr><th colspan="3">Vie de l'index</th></tr></thead>
	<tbody>
		<form method="POST"	action="updateIndex">
			<tr>
				<td>Mot de passe</td>
				<td>
					<input name="pass" value="password"  type="password"/>
				</td>
				<td>
					<input type="submit" value="Mise à jour" />
					<input name="name" value="<%=indexListBean.getName(index) %>"  type="hidden"/>
					<input name="url" value="<%=indexListBean.getURL(index) %>"  type="hidden"/>
					<input name="user" value="<%=indexListBean.getLogin(index) %>"  type="hidden"/>
					<input name="mode" value="<%=indexListBean.getMode(index) %>"  type="hidden"/>
				</td>
			</tr>	
		</form>	
		<form method="POST"	action=".">
			<tr>
				<td>Mot de passe</td>
				<td>
					<input name="pass" value="password"  type="password"/>
				</td>
				<td>	
					<input type="submit" value="Détruire l'index" />
					<input name="index" value="<%=index %>"  type="hidden"/>
					<input name="menu" value="deleteIndex"  type="hidden"/>
					<input name="delname" value="<%=indexListBean.getName(index) %>"  type="hidden"/>
				</td>
			</tr>		
		</form>	
	</tbody>
</table>
<table class="infos_index">	
	<thead><tr><th colspan="3">Exploration de l'index</th></tr></thead>
	<tbody>
		<tr>
				<td><a href="?menu=listIndex&index=<%= index %>">Visualiser</a></td>
		</tr>
	</tbody>
</table>				
