<% dim stext , stNbrA ,sNom ,sDescription ,sType ,sCode ,sAnimateurAdjoint, sAnimateur,sTable,sSqlPer,liensPer,stFormat ,iAge1,iAge2 ,sCout ,sNomType ,strSql1, rsQuery1,stCout dim stActivites,stDescription,iNbrTo,nbrToDisplay,iNbrFrom,lastpage,modul, stType,stStatut,stSexe,stOrder,stAnimateurAdjoint,stAnimateur,stformRap dim semaine, sSemaine,SQLIns, path,S,sExcel,liensIns,stCodeAdmin,sSqlAdmin,liensAdmin,SQLA stOrder = request("Order") stFormat = request("Format") '****Activités paramettres************ stActivites = RemoveJunk(Request("Activites")) '****Personne paramettres************ stCodeAdmin = RemoveJunk(Request("CodeAdmin")) 'parammetre activites ********************* if Request("Type") <> "" then SQLA = SQLA & "Activites.Type = " & Request("Type") & " and " liensIns = liensIns&"Type="&Request("Type") &"&" end if '******Inscription parametres******** if Request("TypeHoraire") = "Semaine" then For S = 1 to Request("NbreSemaines") Step 1 semaine = "Semaine"&S if Request.Form(semaine) = "1" then sSemaine = sSemaine &"-"&s&"-" end if Next if sSemaine <> "" then SQLIns = SQLIns & " Inscriptions.Semaines Like '%" & sSemaine & "%' and " stext = stext &"Semaines : " & sSemaine & " . " liensIns = liensIns&"Semaines="& sSemaine &"&" end if end if if stActivites <> "" then SQLIns = SQLIns & "Inscriptions.CodeA = " & stActivites & " and " stext = stext &"code de l'activité : " & stActivites & " . " liensIns = liensIns&"Activites="&stActivites &"&" end if if Request("Groupe") <> "" then SQLIns = SQLIns & "Inscriptions.Groupe = '" & Request("Groupe") & "' and " stext = stext &"Groupe : " & Request("Groupe") & " . " liensIns = liensIns&"Groupe="&Request("Groupe") &"&" end if '******Admin SQL **************** if Request("CodeAdmin") <> "" then sSqlAdmin = sSqlAdmin & "Payments.CodeAdmin = " & RemoveJunk(Request("CodeAdmin")) & " and " liensAdmin = liensAdmin&"Region="&Request("CodeAdmin") &"&" end if if Request("recu1") <> "" then sSqlAdmin = sSqlAdmin & "Payments.CodeP > " & RemoveJunk(Request("recu1")) & " and " liensAdmin = liensAdmin&"recu1="&Request("recu1") &"&" end if if Request("recu2") <> "" then sSqlAdmin = sSqlAdmin & "Payments.CodeP < " & RemoveJunk(Request("recu2")) & " and " liensAdmin = liensAdmin&"recu2="&Request("recu2") &"&" end if if Request("annuler") = 1 then sSqlAdmin = sSqlAdmin & "Payments.AnnulerR = true and " liensAdmin = liensAdmin&"annuler="&Request("annuler") &"&" end if if Request("Remb") = 1 then sSqlAdmin = sSqlAdmin & "Payments.Remb <> 0 and " liensAdmin = liensAdmin&"Remb="&Request("Remb") &"&" end if if Request("mois")<> "" and Request("jour") <> "" and Request("annee") <> "" then sSqlAdmin = sSqlAdmin & "DatePaiement = #" & Request("annee") & "-" & _ Request("mois") & "-" & Request("jour") & "#" sSqlAdmin = sSqlAdmin & " and " liensAdmin = liensAdmin &"jour="& Request("jour") &"&mois="& Request("mois") &"&annee="& Request("annee") &"&" end if if SQLIns <> "" or sSqlAdmin <> "" or SQLA <> "" then '*********************************** strSql = "SELECT count(*) as iNbrNodes from (( Activites INNER JOIN Inscriptions ON Activites.CodeA = Inscriptions.CodeA )INNER JOIN Payments ON Inscriptions.CodeIns = Payments.CodeIns) where" if SQLA <> "" then strSql = strSql & " "& Left(SQLA, Len(SQLA) - 4)&" and " end if if SQLIns <> "" then strSql = strSql & " "& Left(SQLIns, Len(SQLIns) - 4)&" and " end if if sSqlAdmin <> "" then strSql = strSql & " "& Left(sSqlAdmin, Len(sSqlAdmin) - 4)&" and " end if Set rsQuery = Conn.Execute(Left(strSql, Len(strSql) - 4)) nbrToDisplay = rsQuery("iNbrNodes") '***************************************** sSQL = "SELECT Inscriptions.*, Payments.* FROM (( Activites INNER JOIN Inscriptions ON Activites.CodeA = Inscriptions.CodeA )INNER JOIN Payments ON Inscriptions.CodeIns = Payments.CodeIns) where" if SQLA <> "" then sSQL = sSQL & " "& Left(SQLA, Len(SQLA) - 4)&" and " end if if SQLIns <> "" then sSQL = sSQL & " "& Left(SQLIns, Len(SQLIns) - 4)&" and " end if if sSqlAdmin <> "" then sSQL = sSQL & " "& Left(sSqlAdmin, Len(sSqlAdmin) - 4)&" and " end if sSQL = Left(sSQL, Len(sSQL) - 4) 'Response.Write sSQL '********************************** if nbrToDisplay <> "0" then Set RS = Conn.Execute(sSQL) 'RS.Open sSQL, Conn, adOpenStatic '************************************************** %>
<% 'The following 2 lines are what makes this happen... Response.ContentType ="Application/vnd.excel" Response.AddHeader "Content-Disposition", "attachment; filename=Paiments.xls" %> <%=stext%>
<%if nbrToDisplay <> "0" then%>
<% Do While Not RS.EOF dim sCodeM ,sCodeA,sNomA,sPrenom,sDDN sCodeM = RS("CodeM") sCodeA = RS("CodeA") sGroupe = RS("Groupe") strSql1 = "SELECT * FROM Personnes where CodeM = "& sCodeM Set rsQuery1 = Conn.Execute(strSql1) if not rsQuery1.eof then sNom = rsQuery1("Nom") sPrenom = rsQuery1("Prenom") sDDN = rsQuery1("DDN") end if strSql1 = "SELECT * FROM Activites where CodeA = "& sCodeA Set rsQuery1 = Conn.Execute(strSql1) if not rsQuery1.eof then sNomA = rsQuery1("Nom") sCout = rsQuery1("Cout") end if if RS("CodeAdmin") <> "" then strSql1 = "SELECT * FROM Admin where CodeAdmin = "& RS("CodeAdmin") Set rsQuery1 = Conn.Execute(strSql1) if not rsQuery1.eof then sNomAdmin = rsQuery1("Nom") sPrenomAdmin = rsQuery1("Prenom") end if end if %> <% 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 Prenom Acompte Tax Totale  Remboursement mode de paiment Date de paiment Activité Groupe N° Reçu Admin
<%=RS("NomP")%> <%=RS("PrenomP")%> <%=RS("Acomptes")%> <%=RS("Tax")%> <%=(RS("Tax")+ RS("Acomptes")) %> <%=RS("Remb")%> <%=RS("ModePaiement")%> <%=RS("DatePaiement")%> <%=sNomA%> <%=sGroupe%> <%=RS("CodeP")%> <%=sPrenomAdmin%>  <%=sNomAdmin%>

<%else%>

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

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