%@ Language=VBScript %> <% Option Explicit %> <% Response.Buffer = True %> <% dim stNom, stPrenom, stCodeR,stformAdmin ,iNbrTo,nbrToDisplay,iNbrFrom,lastpage,modul,sNom, sPrenom, sCode, sDDN ,colonne dim stTelRAdmin,stTelTAdmin,stCellulaireAdmin,liensAdmin ,stSexe,stStatut ,sSQLAdmin,stOrder ,stCodeAdmin stCodeAdmin = RemoveJunk(Request("CodeAdmin")) stNom = RemoveJunk(Request("NomAdmin")) stPrenom = RemoveJunk(Request("PrenomAdmin")) stSexe = Request("SexeAdmin") stStatut = Request("StatutAdmin") stTelRAdmin = RemoveJunk(Request("TelRAdmin")) stTelTAdmin = RemoveJunk(Request("TelTAdmin")) stCellulaireAdmin = RemoveJunk(Request("CellulaireAdmin")) stformAdmin = Request("formAdmin") if stformAdmin <> "" then liensAdmin = liensAdmin&"formAdmin="&stformAdmin &"&" end if if request("OrderAdmin") <> "" then stOrder = request("OrderAdmin") else stOrder = "Nom" end if liensAdmin = liensAdmin &"OrderAdmin="&stOrder &"&" '************************************ Const adUseClient = 3 Const adOpenStatic = 3 Dim Connect_String Dim Page_Size Dim Current_Page Dim MyConn Dim RS,rsQuery Dim sSQLA, strSql Dim Page_Count '****************** Page_Size = 10 'here we set the number of records viewed per page to 15. 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 stCodeAdmin <> "" then sSQLAdmin = sSQLAdmin & "Admin.CodeAdmin = " & stCodeAdmin & " and " liensAdmin = liensAdmin&"CodeAdmin="& Request("CodeAdmin") &"&" end if if stNom <> "" then sSQLAdmin = sSQLAdmin & "Admin.Nom Like '" & stNom & "%' and " liensAdmin = liensAdmin&"NomAdmin="& Request("NomAdmin") &"&" end if if stPrenom <> "" then sSQLAdmin = sSQLAdmin & "Admin.Prenom Like '" & stPrenom & "%' and " liensAdmin = liensAdmin&"PrenomAdmin="& Request("PrenomAdmin") &"&" end if if stSexe <> "" then sSQLAdmin = sSQLAdmin & "Admin.Sexe = '" & stSexe & "' and " liensAdmin = liensAdmin&"SexeAdmin="& stSexe &"&" end if if Request("moisAdmin") <> "" and Request("jourAdmin") <> "" and Request("anneeAdmin") <> "" then sSQLAdmin = sSQLAdmin & "Admin.DDN = #" & Request("anneeAdmin") & "-" & _ Request("moisAdmin") & "-" & Request("jourAdmin") & "#" sSQLAdmin = sSQLAdmin & " and " liensAdmin = liensAdmin&"moisAdmin="& Request("moisAdmin") &"&jourAdmin="& Request("jourAdmin") &"&anneeAdmin="& Request("anneeAdmin") &"&" end if if stStatut <> "" then sSQLAdmin = sSQLAdmin & " Admin.Statut = " & stStatut & " and" liensAdmin = liensAdmin&"StatutAdmin="& stStatut &"&" end if if stTelRAdmin <> "" then sSQLAdmin = sSQLAdmin & " Admin.TelR= '" & stTelRAdmin & "' and" liensAdmin = liensAdmin&"TelRAdmin="& Request("TelRAdmin") &"&" end if if stTelTAdmin <> "" then sSQLAdmin = sSQLAdmin & " Admin.TelT = '" & stTelTAdmin & "' and" liensAdmin = liensAdmin&"TelTAdmin="& Request("TelTAdmin") &"&" end if if stCellulaireAdmin <> "" then sSQLAdmin = sSQLAdmin & " Admin.Cellulaire = '" & stCellulaireAdmin & "' and" liensAdmin = liensAdmin&"CellulaireAdmin="& Request("CellulaireAdmin") &"&" end if '*******permission********** if Request("PersonneA") = 1 then sSQLAdmin = sSQLAdmin & " Admin.PersonneA = true and" liensAdmin = liensAdmin&" PersonneA ="& Request("PersonneA") &"&" end if if Request("PersonneM") = 1 then sSQLAdmin = sSQLAdmin & " Admin.PersonneM = true and" liensAdmin = liensAdmin&" PersonneM ="& Request("PersonneM") &"&" end if if Request("PersonneS") = 1 then sSQLAdmin = sSQLAdmin & " Admin.PersonneS = true and" liensAdmin = liensAdmin&" PersonneS ="& Request("PersonneS") &"&" end if '*************************** '******Activites*********** if Request("ActiviteA") = 1 then sSQLAdmin = sSQLAdmin & " Admin.ActiviteA = true and" liensAdmin = liensAdmin&" ActiviteA ="& Request("ActiviteA") &"&" end if if Request("ActiviteM") = 1 then sSQLAdmin = sSQLAdmin & " Admin.ActiviteM = true and" liensAdmin = liensAdmin&" ActiviteM ="& Request("ActiviteM") &"&" end if if Request.Form("ActiviteS") = 1 then sSQLAdmin = sSQLAdmin & " Admin.ActiviteS = true and" liensAdmin = liensAdmin&" ActiviteS ="& Request("ActiviteS") &"&" end if '*************************** '*****Inscription*********** if Request("InscriptionA") = 1 then sSQLAdmin = sSQLAdmin & " Admin.InscriptionA = true and" liensAdmin = liensAdmin&" InscriptionA ="& Request("InscriptionA") &"&" end if if Request("InscriptionM") = 1 then sSQLAdmin = sSQLAdmin & " Admin.InscriptionM = true and" liensAdmin = liensAdmin&" InscriptionM ="& Request("InscriptionM") &"&" end if if Request("InscriptionS") = 1 then sSQLAdmin = sSQLAdmin & " Admin.InscriptionS = true and" liensAdmin = liensAdmin&" InscriptionS ="& Request("InscriptionS") &"&" end if '**************************** '*******Salle**************** if Request("SalleA") = 1 then sSQLAdmin = sSQLAdmin & " Admin.SalleA = true and" liensAdmin = liensAdmin&" SalleA ="& Request("SalleA") &"&" end if if Request("SalleM") = 1 then sSQLAdmin = sSQLAdmin & " Admin.SalleM = true and" liensAdmin = liensAdmin&" SalleM ="& Request("SalleM") &"&" end if if Request("SalleS") = 1 then sSQLAdmin = sSQLAdmin & " Admin.SalleS = true and" liensAdmin = liensAdmin&" SalleS ="& Request("SalleS") &"&" end if '**************************** '*****Equipement********* if Request("EquipementA") = 1 then sSQLAdmin = sSQLAdmin & " Admin.EquipementA = true and" liensAdmin = liensAdmin&" EquipementA ="& Request("EquipementA") &"&" end if if Request("EquipementM") = 1 then sSQLAdmin = sSQLAdmin & " Admin.EquipementM = true and" liensAdmin = liensAdmin&" EquipementM ="& Request("EquipementM") &"&" end if if Request("EquipementS") = 1 then sSQLAdmin = sSQLAdmin & " Admin.EquipementS = true and" liensAdmin = liensAdmin&" EquipementS ="& Request("EquipementS") &"&" end if '********************* '*****Organisation***** if Request("OrganisationA") = 1 then sSQLAdmin = sSQLAdmin & " Admin.OrganisationA = true and" liensAdmin = liensAdmin&" OrganisationA ="& Request("OrganisationA") &"&" end if if Request.Form("OrganisationM") = 1 then sSQLAdmin = sSQLAdmin & " Admin.OrganisationM = true and" liensAdmin = liensAdmin&" OrganisationM ="& Request("OrganisationM") &"&" end if if Request.Form("OrganisationS") = 1 then sSQLAdmin = sSQLAdmin & " Admin.OrganisationS = true and" liensAdmin = liensAdmin&" OrganisationS ="& Request("OrganisationS") &"&" end if '*************************** '*******Rapport************ if Request.Form("RapportA") = 1 then sSQLAdmin = sSQLAdmin & " Admin.RapportA = true and" liensAdmin = liensAdmin&" RapportA ="& Request("RapportA") &"&" end if if Request.Form("RapportM") = 1 then sSQLAdmin = sSQLAdmin & " Admin.RapportM = true and" liensAdmin = liensAdmin&" RapportM ="& Request("RapportM") &"&" end if if Request.Form("RapportS") = 1 then sSQLAdmin = sSQLAdmin & " Admin.RapportS = true and" liensAdmin = liensAdmin&" RapportS ="& Request("RapportS") &"&" end if '************************ if sSQLAdmin <> "" then strSql = "SELECT count(*) as iNbrNodes FROM Admin WHERE "& Left(sSQLAdmin, Len(sSQLAdmin) - 4)&" " Set rsQuery = Conn.Execute(strSql) nbrToDisplay = rsQuery("iNbrNodes") sSQLA = "SELECT * from Admin WHERE "& Left(sSQLAdmin, Len(sSQLAdmin) - 4)&" order by "&stOrder&"" else Response.Redirect ("RechercheAdminF.asp?formAdmin="&stformAdmin &"") end if '********************************** if nbrToDisplay <> "0" then RS.Open sSQLA, 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 '************************************************** Response.Cookies("Current_PageAdmin") = Current_Page 'Response.Cookies("Current_PageAdmin").expires = Now + 360 Response.Cookies("liensAdmin") = liensAdmin 'Response.Cookies("liensAdmin").expires = Now + 360 %> <% if Session("SuperAdmin") = false then Response.Redirect (""&path&"/index.asp") end if %>
|