<%
/******************************************************************************
 * Copyright (c) 2000-2004 e-Deal
 *
 * e-Deal S.A.
 * 55 rue Brillat Savarin
 * 75013 Paris
 * France
 *
 * T: +33 (0)1 53 80 80 30
 * F: +33 (0)1 73 01 69 77
 * http://www.e-deal.com
 * 
 * La diffusion de ce code source sous quelque forme que ce soit sans
 * l'autorisation de E-DEAL est interdite.
 *
 * Vous êtes autorisés à modifier ce code source uniquement pour votre usage
 * propre et sous réserve que les mentions de copyright demeurent intactes.
 *
 * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou
 * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour
 * responsable des dommages pouvant résulter de l'utilisation de ce code
 * source.
 *
 *
 ******************************************************************************/
%><%@page session="true" import="com.edeal.frontline.*,java.util.*"%><%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl"%><%
	final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass());
	String contextPath = (String)session.getAttribute("contextPath");
	FlContext context = null;
	if(contextPath != null) {
		context = Frontline.getContext(contextPath);
	} else {
		context = Frontline.getContext(request.getContextPath());
	}
	DataDictionary dico = context.getDataDictionary();
	String pOdrNam = Utils.getRequestParameter(context, request, "OdrNam");
	String pOdrCod = Utils.getRequestParameter(context, request, "OdrCod");
	String pOdrUrl = Utils.getRequestParameter(context, request, "OdrUrl");

	Vector vectQuery = new Vector();

	if(pOdrNam != null && !pOdrNam.equals("")) {
		vectQuery.addElement(new String[]{"OdrNam like " + Utils.formatToSQL(context, pOdrNam + "%"), "OdrNam like " + Utils.formatToSQL(context, "% " + pOdrNam + "%")});
	}

	if(pOdrCod != null && !pOdrCod.equals("")) {
		vectQuery.addElement(new String[]{"OdrCod like " + Utils.formatToSQL(context, "%" + pOdrCod + "%")});
	}

	if(pOdrUrl != null && !pOdrUrl.equals("")) {
		vectQuery.addElement(new String[]{"OdrUrl like " + Utils.formatToSQL(context, "%" + pOdrUrl + "%")});
	}

	String[] fields = {"OdrID", "OdrUrl", "OdrNam", "OdrCod"};
	String[][] query = null;
	String[] orderBy = {"OdrNam"};

	if(vectQuery.size() > 0) {
		query = new String[vectQuery.size()][];
		for(int i = 0; i < vectQuery.size(); i++) {
			query[i] = (String[])vectQuery.elementAt(i);
		}
	}

	Vector objs = OutDoorBean.listSummary(session, fields, query, orderBy, true);

	boolean hasEntries = objs.size() > 0;

%>
<html>
<head>
<title>E-DEAL</title>

<script language="JavaScript">

function doSelect(id) {
	window.parent.location = '<fl:webapp/>/netbusiness/outdoor/view.jsp?id=' + id;
}

function doDelete(id, lbl) {
	if(window.confirm('<fl:getMessage code="M0015" alt="Etes-vous sûr de vouloir supprimer la porte de sortie" js="true"/> "' + lbl + '" ?')) {
		window.parent.location = '<fl:webapp/>/performAction?op=del&typ=OutDoor&id=' + id + '&disp=netbusiness/outdoor/list.jsp';
	}
}

</script>

</head>
<body>
<%	if(!hasEntries) { %>
<p><fl:getMessage code="L0001" alt="Aucune entrée disponible"/></p>
<%	} else { %>
<table border="0" cellpadding="3" cellspacing="3">
	<tr valign="top">
		<td class="transparent"></td>
		<th nowrap><fl:getMessage code="F2025" alt="Nom"/></th>
		<th nowrap><fl:getMessage code="F2000" alt="Code"/></th>
		<th nowrap><fl:getMessage code="F0028" alt="URL associée"/></th>
		<!--th nowrap><fl:getMessage code="L2007" alt="Description"/></th-->
	</tr>
<%		for(int i = 0; i < objs.size(); i++) {
			Hashtable obj = (Hashtable)objs.elementAt(i); %>
	<tr valign="top">
		<td class="transparent" nowrap><a href="javascript:doDelete('<%= (String)obj.get("OdrID") %>','<%= Utils.formatToJavascript((String)obj.get("OdrNam")) %>')"><img src="<fl:webapp/>/icons/trashsmall.gif" alt="<fl:getMessage code="A0007" alt="supprimer"/>" border="0" width="15" height="15"></a></td>
		<td align="left" nowrap><a href="javascript:doSelect('<%= (String)obj.get("OdrID") %>')"><%= Utils.formatToWeb((String)obj.get("OdrNam"), false) %></a></td>
		<td align="left" nowrap><%= Utils.formatToWeb((String)obj.get("OdrCod"), false) %></td>
		<td align="left" nowrap><%= Utils.formatToWeb((String)obj.get("OdrUrl"), false) %></td>
		<!--td align="left" nowrap><%= Utils.formatToWeb((String)obj.get("OdrDsc"), false) %></td-->
	</tr>
<%		} %>
</table>
<%	} %>
</body>
</html>
<%
/******************************************************************************
 * CVS Log File - This is no longer maintained!
 *
 * Revision 1.1  2004/07/23 18:20:52  brian
 * Initial Revision
 *
 *****************************************************************************/
%>
