% Function GetDaysInMonth(iMonth, iYear) Dim dTemp dTemp = DateAdd("d", -1, DateSerial(iYear, iMonth + 1, 1)) GetDaysInMonth = Day(dTemp) End Function Function NomMois(imonth) if imonth=1 then NomMois="Janvier" if imonth=2 then NomMois="Février" if imonth=3 then NomMois="Mars" if imonth=4 then NomMois="Avril" if imonth=5 then NomMois="Mai" if imonth=6 then NomMois="Juin" if imonth=7 then NomMois="Juillet" if imonth=8 then NomMois="Août" if imonth=9 then NomMois="Septembre" if imonth=10 then NomMois="Octobre" if imonth=11 then NomMois="Novembre" if imonth=12 then NomMois="Décembre" End Function Function Categorie(nomcat) if nomcat="toutes" then Categorie="Les manifestations prévues " if nomcat="SPECTACLE" then Categorie="Les spectacles prévus " if nomcat="CONFERENCE" then Categorie="Les conférences prévues " if nomcat="SPORT" then Categorie="Les manifestations sportives prévues " if nomcat="EXPOSITION" then Categorie="Les expositions prévues " if nomcat="STAGE" then Categorie="Les stages prévus " if nomcat="VISITE" then Categorie="Les visites prévues " if nomcat="RENCONTRE" then Categorie="Les rencontres prévues " End Function Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "DBQ=" & Server.Mappath("../data/agenda.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};" Set RS = Server.CreateObject("ADODB.Recordset") If Request.Form("Envoyer")="Consulter" then trouve=1 anneedebut=request.form("anneedebut") anneefin=request.form("anneefin") datedebut=request.form("mois1")&"/"&request.form("jour1")&"/"&anneedebut datefin=request.form("mois2")&"/"&request.form("jour2")&"/"&anneefin jour1=request.form("jour1") jour2=request.form("jour2") if not IsDate(datedebut) then datedebut=request.form("mois1")&"/"&GetDaysInMonth(request.form("mois1"),anneedebut)&"/"&anneedebut jour1=GetDaysInMonth(request.form("mois1"),anneedebut) end if if not IsDate(datefin) then datefin=request.form("mois2")&"/"&GetDaysInMonth(request.form("mois2"),anneefin)&"/"&anneefin jour2=GetDaysInMonth(request.form("mois2"),anneefin) end if end if %>
Pas de manifestations prévues dans cette période.
<%Else debut=request.form("jour1")&"/"&request.form("mois1")&"/"&anneedebut fin=request.form("jour2")&"/"&request.form("mois2")&"/"&anneefin %><%=Categorie(request.form("categorie")) %>du <%=FormatDateTime(debut,2)%> au <%=FormatDateTime(fin,2)%>
| date | Genre | Titre | Lieu |
| <% if rs("date_de_fin")=rs("date_de_debut") then response.write "Le "& rs("date_de_debut") else response.write "Du "& rs("date_de_debut")&" au "&rs("date_de_fin") end if %> |
<%=rs("categorie")%> |
<%=rs("LIEU")%> |