Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\siteweb\faq_search.jsp
<% /****************************************************************************** * 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" %> <%! String[][] retrieveQuery(String str, String op1, String op2) { Vector vectQuery = Utils.explodeList(str, op1); for(int i = 0; i < vectQuery.size(); i++) { vectQuery.setElementAt(((String)vectQuery.elementAt(i)).trim(), i); } vectQuery = Utils.explodeList(Utils.implodeList(vectQuery, op1), op2); String[][] result = new String[vectQuery.size()][0]; for(int i = 0; i < vectQuery.size(); i++) { Vector vectFact = Utils.explodeList((String)vectQuery.elementAt(i), op1); result[i] = (String[])vectFact.toArray(result[i]); } return result; } %> <% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); String contextPath = (String)session.getAttribute("contextPath"); if(contextPath == null) { contextPath = request.getContextPath(); } FlContext context = Frontline.getContext(contextPath); DataDictionary dico = context.getDataDictionary(); String paramLngID = Utils.getRequestParameter(context, request, "LngID"); String paramQuery = Utils.getRequestParameter(context, request, "query"); String paramCatID = Utils.getRequestParameter(context, request, "CatID"); String[] paramKeyID = Utils.translateParameterValues(context, request.getParameterValues( "KeyID")); Vector vectKeyID = null; if(paramKeyID == null) { vectKeyID = new Vector(); } else { vectKeyID = new Vector(Arrays.asList(paramKeyID)); } Vector objs = null; try { String[] fields = {"FaqID", "FaqQuestion"}; String[][] query = {{}}; String[] orderBy = {"FaqQuestion"}; if(paramLngID != null && !"".equals(paramLngID)) { String[][] newQuery = {{"FaqLngID = " + Utils.formatToSQL(context, paramLngID)}}; query = Utils.concatQuery(query, newQuery, null); } if(paramQuery != null && !"".equals(paramQuery)) { String[][] newQueQuery = retrieveQuery(paramQuery, "+", " "); String[][] newQuery = new String[newQueQuery.length * 2][0]; for(int i = 0; i < newQueQuery.length; i++) { newQuery[i] = new String[newQueQuery[i].length]; newQuery[i + newQueQuery.length] = new String[newQueQuery[i].length]; for(int j = 0; j < newQueQuery[i].length; j++) { newQuery[i][j] = "FaqQuestion like " + Utils.formatToSQL(context, "%" + newQueQuery[i][j] + "%"); newQuery[i + newQueQuery.length][j] = "FaqResponse like " + Utils.formatToSQL(context, "%" + newQueQuery[i][j] + "%"); } } query = Utils.concatQuery(query, newQuery, null); } if(paramCatID != null && !"".equals(paramCatID)) { String[][] newQuery = {{"FaqFahID:FahCatID = " + Utils.formatToSQL(context, paramCatID)}}; query = Utils.concatQuery(query, newQuery, null); } if(paramKeyID != null) { String keysID = ""; for(int i = 0; i < paramKeyID.length; i++) { keysID += (i == 0 ? "" : ", ") + Utils.formatToSQL(context, paramKeyID[i]); } String[][] newQuery = {{"FaqFahID:FahKeyID contains (" + keysID + ")"}}; query = Utils.concatQuery(query, newQuery, null); } objs = FAQBean.listSummary(context, fields, query, orderBy); } catch (Exception ex) { } boolean hasEntries = (objs != null && objs.size() > 0); %> <html> <head> <title><fl:getMessage code="L2025" alt="E-DEAL"/></title> <style type="text/css"> # { font-family: Arial, Helvetica, sans-serif; font-size: 9pt } BODY { background-color: #ffffff; color: #000000 } TH {text-align: left; font-weight: bold } </style> <script language="JavaScript"> var submitFlag = false; function doSubmit() { if(!submitFlag) { submitFlag = true; var f = document.forms[0]; presentFieldsValue(); f.submit(); } } function doViewFAQ(id) { window.location = '<fl:webapp/>/editfaq_siteweb.fl?id=' + id ; } </script> </head> <body> <table border="0" cellpadding="3" cellspacing="3" width="95%"> <form method="post" action="faq_search.jsp"> <tr valign="top"> <td width="25%"><p style="text-align: center; font-size: 72pt; font-weight: bold">FAQ</p></td> <td width="75%"> <p> <table border="0" cellpadding="1" cellspacing="3"> <tr valign="top"> <td> <table border="0" cellpadding="3" cellspacing="3"> <tr valign="top"> <td> <select name="LngID"> <% Vector vectLngID = dico.getRefList(session, "FaqLngID"); for(int i = 0; i < vectLngID.size(); i++) { Vector lng = (Vector)vectLngID.elementAt(i); String lngID = (String)lng.elementAt(0); %> <option value="<%= lngID %>"<%= lngID.equals(paramLngID) ? " selected" : "" %>><%= Utils.formatToWeb((String)lng.elementAt(1), false) %></option> <% } %> </select> </td> <td><input name="query" type="text" value="<%= Utils.formatToWeb(paramQuery, true) %>" size="40"></td> <td><input type="submit" value="rechercher"></td> </tr> </table> </td> </tr> </table> </p> <p> <table border="0" cellpadding="1" cellspacing="3"> <tr valign="top"> <td bgcolor="black"> <table border="0" cellpadding="3" cellspacing="3" bgcolor="white" width="100%"> <tr valign="top"> <th colspan="2">Recherche précise ...</th> </tr> <tr valign="top"> <th style="text-align: right">Catégorie</th> <td> <select name="CatID"> <option value=""><Choisissez une catégorie></option> <% Vector vectCatID = dico.getRefList(session, "FahCatID"); for(int i = 0; i < vectCatID.size(); i++) { Vector cat = (Vector)vectCatID.elementAt(i); String catID = (String)cat.elementAt(0); %> <option value="<%= catID %>"<%= catID.equals(paramCatID) ? " selected" : "" %>><%= Utils.formatToWeb((String)cat.elementAt(1), false) %></option> <% } %> </select> </td> </tr> <tr valign="top"> <th style="text-align: right">Mots clés</th> <td><table border="0" cellpadding="1" cellspacing="1"> <% Vector vectRefList = dico.getRefList(session, "FahKeyID"); for(int i = 0; i < vectRefList.size(); i++) { Vector vectRef = (Vector)vectRefList.elementAt(i); String refID = (String)vectRef.elementAt(0); String refDisp = (String)vectRef.elementAt(1); if((i % 2) == 0) { %> <tr valign="top"><% } %> <td width="50%"><input name="KeyID" type="checkbox" value="<%= refID %>"<%= vectKeyID.contains(refID) ? " checked" : "" %>><%= Utils.formatToWeb(refDisp, false) %></input></td><% if((i % 2) == 1) { %> </tr><% } } if(vectRefList.size() > 0 && (vectRefList.size() % 2) != 0) { %> <td> </td> </tr><% } %> </table></td> </tr> </table> </td> </tr> </table> </p> </td> </tr> </form> </table> <% if(objs != null) { %> <hr> <% if(!hasEntries) { %> Aucune réponse ne correspond aux critères saisis. <% } else { for(int i = 0; i < objs.size(); i++) { Hashtable obj = (Hashtable)objs.elementAt(i); %> <a href="javascript:doViewFAQ('<%= (String)obj.get("FaqID") %>')"><%= Utils.formatToWeb((String)obj.get("FaqQuestion"), false) %></a><br> <% } } } %> </body> </html> <% /****************************************************************************** * CVS Log File - This is no longer maintained! * * Revision 1.1 2004/07/23 18:21:01 brian * Initial Revision * *****************************************************************************/ %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de