<%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer = True %> FQCCL <% dim stext , stFormat ,sNom ,sPrenom ,sDDN ,sCode ,sAdresse, sVille,sTable ,iAge1,iAge2 dim stNom,stPrenom,iNbrTo,nbrToDisplay,iNbrFrom,lastpage,modul, stRegion,stStatut,stSexe,stOrder,stCodepostal,stVille,stformRap,liensRapP stOrder = request("Order") liensRapP = liensRapP &"Order="&stOrder &"&" stFormat = request("Format") stNom = RemoveJunk(Request("Nom")) stPrenom = RemoveJunk(Request("Prenom")) stSexe = Request("Sexe") stStatut = Request("Statut") stRegion = RemoveJunk(Request("Region")) stVille = RemoveJunk(Request("Ville")) stCodepostal = RemoveJunk(Request("codepostal")) iAge1 = Request("Age1") iAge2 = Request("Age2") stformRap = Request("formRap") liensRapP = liensRapP &"formRap="&stformRap &"&" if Request("formRap") = "P" then sTable = "Participants" end if if Request("formRap") = "M" then sTable = "Membres" end if if Request("formRap") = "B" then sTable = "Benevoles" end if if Request("formRap") = "E" then sTable = "employes" end if '************************************ Const adUseClient = 3 Const adOpenStatic = 3 Dim Connect_String Dim Page_Size Dim Current_Page Dim MyConn Dim RS,rsQuery Dim sSQL, strSql, sSqlR Dim Page_Count '****************** Page_Size = 15 'here we set the number of records viewed per page to 20. If Request("iPage")="1" Then Current_Page = 1 Else Current_Page = CInt(Request("iPage")) End If Set RS = Server.CreateObject("ADODB.RecordSet") RS.CursorLocation = adUseClient RS.PageSize = Page_Size '************************************************** if stNom <> "" then sSqlR = sSqlR & "Personnes.Nom Like '" & stNom & "%' and " stext = stext &"Nom : " & stNom & " . " liensRapP = liensRapP &"Nom="&Request("Nom") &"&" end if if stPrenom <> "" then sSqlR = sSqlR & "Personnes.Prenom Like '" & stPrenom & "%' and " stext = stext &"Prenom : " & stPrenom & " . " liensRapP = liensRapP &"Prenom="&Request("Prenom") &"&" end if if stSexe <> "" then sSqlR = sSqlR & "Personnes.Sexe = '" & stSexe & "' and " stext = stext &"Sexe: " & stSexe & " . " liensRapP = liensRapP &"Sexe="&stSexe &"&" end if if Request("mois")<> "" and Request("jour") <> "" and Request("annee") <> "" then sSqlR = sSqlR & "Personnes.DDN = #" & Request("annee") & "-" & _ Request("mois") & "-" & Request("jour") & "#" sSqlR = sSqlR & " and " stext = stext &"DDN: " & Request("mois") & "/" & Request("jour") & "/" & Request("annee") & " . " liensRapP = liensRapP &"jour="& Request("jour") &"&mois="& Request("mois") &"&annee="& Request("annee") &"&" end if if Request("moisExp")<> "" and Request("jourExp") <> "" and Request("anneeExp") <> "" then sSqlR = sSqlR & "Personnes.DateExp = #" & Request("anneeExp") & "-" & _ Request("moisExp") & "-" & Request("jourExp") & "#" sSqlR = sSqlR & " and " stext = stext &"date d'expiration: " & Request("moisExp") & "/" & Request("jourExp") & "/" & Request("anneeExp") & " . " liensRapP = liensRapP &"jourExp="& Request("jourExp") &"&moisExp="& Request("moisExp") &"&anneeExp="& Request("anneeExp") &"&" end if if stStatut <> "" then 'sSqlR = sSqlR & " Personnes.Statut = " & stStatut & " and" if stStatut = "0" then stext = stext &"Statut: Inactif . " end if if stStatut = "1" then stext = stext &"Statut: Actif . " end if liensRapP = liensRapP &"Statut="&stStatut &"&" end if if stRegion <> "" then sSqlR = sSqlR & " Personnes.Region = " & stRegion & " and" stext = stext &"Region: " & stRegion & " . " liensRapP = liensRapP &"Region="&Request("Region") &"&" end if if stVille <> "" then sSqlR = sSqlR & " Personnes.Ville = '" & stVille & "' and" stext = stext &"Ville: " & stVille & " . " liensRapP = liensRapP &"Ville="&Request("Ville") &"&" end if if stCodepostal <> "" then sSqlR = sSqlR & " Personnes.CodePostal = '" & stCodepostal & "' and" stext = stext &"Code postal: " & stCodepostal & " . " liensRapP = liensRapP &"Codepostal="&Request("codepostal") &"&" end if if iAge1 <> "" and iAge2 <> "" then sSqlR = sSqlR & "( year (date()) - year(Personnes.DDN) >= " & iAge1 & " and year (date()) - year(Personnes.DDN) <= " & iAge2 & " ) and " stext = stext &"Age entre : " & iAge1 & " et " & iAge2 & " . " liensRapP = liensRapP &"Age1="&iAge1&"&Age2="&iAge2&"&" end if if iAge1 <> "" and iAge2 = "" then sSqlR = sSqlR & "( year (date()) - year(Personnes.DDN) = " & iAge1 & ") and " stext = stext &"Age : " & iAge1 & " . " liensRapP = liensRapP &"Age1="&iAge1&"&" end if 'Response.Write sSqlR '*******Excel************* if stFormat = "E" then Response.Redirect ("rapportPExcel.asp?"& Left(liensRapP, Len(liensRapP) - 1)&"") end if if sSqlR <> "" or stStatut <> "" then '*******Participant******************************************** if Request("formRap")= "P" then strSql = "SELECT count(*) as iNbrNodes FROM Personnes WHERE " if sSqlR <> "" then strSql = strSql & " "& Left(sSqlR, Len(sSqlR) - 4)&" and " end if strSql = strSql & "CodeM IN (SELECT CodeM FROM Participants " if stStatut <> "" then strSql = strSql & "where Statut = " & stStatut & " " end if strSql = strSql & ") " Set rsQuery = Conn.Execute(strSql) nbrToDisplay = rsQuery("iNbrNodes") '********** '***** sSQL = "SELECT Personnes.*, Participants.Statut, Participants.* from Personnes INNER JOIN Participants ON Personnes.CodeM = Participants.CodeM WHERE " if sSqlR <> "" then sSQL = sSQL & " ("& Left(sSqlR, Len(sSqlR) - 4)&") " if stStatut <> "" then sSQL = sSQL & "and " end if end if if stStatut <> "" then sSQL = sSQL & "(Participants.Statut = " & stStatut & ") " end if end if 'strSql = "SELECT count(*) as iNbrNodes FROM Personnes WHERE "& Left(sSqlR, Len(sSqlR) - 4)&" and CodeM IN (SELECT CodeM FROM "& sTable&" ) " 'Set rsQuery = Conn.Execute(strSql) 'nbrToDisplay = rsQuery("iNbrNodes") 'sSQL = "SELECT * from Personnes WHERE "& Left(sSqlR, Len(sSqlR) - 4)&" and CodeM IN (SELECT CodeM FROM "& sTable&" ) order by "&stOrder&" " 'else '****ici pour verifier si il n y a pas de paramettre on reviens a la page de recherche 'response.redirect end if '********************************** if sSqlR <> "" or stStatut <> "" then if nbrToDisplay <> "0" then RS.Open sSQL, Conn, adOpenStatic Page_Count = RS.PageCount If 1 > Current_Page Then Current_Page = 1 If Current_Page > Page_Count Then Current_Page = Page_Count RS.AbsolutePage = Current_Page end if 'iNbrFrom If Current_Page ="1" Then iNbrFrom = 1 iNbrTo = Page_Size Else iNbrFrom = Page_Size * (Current_Page - 1) iNbrTo = iNbrFrom + Page_Size End If modul = nbrToDisplay MOD Page_Size if modul <> "0" then lastpage = Cint(nbrToDisplay/Page_Size) + 1 else lastpage = Cint(nbrToDisplay/Page_Size) end if '************************************************** %>
<%=stext%>
<%if nbrToDisplay <> "0" then%>
<% if iNbrTo < nbrToDisplay then %> <%=iNbrFrom%> à <%=iNbrTo%> de <%=nbrToDisplay%> enregistrements
<%else%> <%=iNbrFrom%> à <%=nbrToDisplay%> de <%=nbrToDisplay%> enregistrements
<%end if%> <% If Current_Page <> 1 Then Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write " " & vbCrLf End If If Current_Page < Page_Count Then Response.Write "" & vbCrLf Response.Write "" & vbCrLf End IF %>
<%Do While RS.AbsolutePage = Current_Page AND Not RS.EOF sNom = RS("Nom") sPrenom = RS("Prenom") sDDN = RS("DDN") sCode = RS("CodeM") sAdresse = RS("Adresse") sVille = RS("Ville") %> <% RS.MoveNext Loop 'clean up RS.Close Set RS = Nothing Conn.Close Set Conn = Nothing end if 'to check if we have select or not %>
Nom Prénom Adresse Ville DDN
<%=sNom%> <%=sPrenom%> <%=sAdresse%> <%=sVille%> <%=sDDN%>

<%if nbrToDisplay <> "0" then%> <%if iNbrTo < nbrToDisplay then %> <%=iNbrFrom%> à <%=iNbrTo%> de <%=nbrToDisplay%> enregistrements
<%else%> <%=iNbrFrom%> à <%=nbrToDisplay%> de <%=nbrToDisplay%> enregistrements
<%end if%> <% If Current_Page <> 1 Then Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write " " & vbCrLf End If If Current_Page < Page_Count Then Response.Write "" & vbCrLf Response.Write "" & vbCrLf End IF %> <%else%>

Pas de résultat <%end if%> <%else%>

Aucun paramètre de recherche sélectionné <%end if%>