%@LANGUAGE="VBSCRIPT"%>
<% UrlPage = "festivite.asp" %>
<%
dim Petat
if Request.QueryString("simul") = "" then Petat=" AND Etat = 1" end if
set rsfestif = Server.CreateObject("ADODB.Recordset")
rsfestif.ActiveConnection = adthv
rsfestif.Source = "SELECT TitreActu, IdActu, NomAppelActu, ResumeActu, DateActuManif FROM T_ActuVille WHERE CodeInsee="&refinsee&" AND NomAppelActu='une' AND getdate()>DateActu AND getdate()<=DateObsoleteActu"&PEtat&" ORDER BY DateActuManif ASC"
set Communes = Server.CreateObject("ADODB.Recordset")
Communes.ActiveConnection = MM_CDT_STRING
Communes.Source = "SELECT COMMUNE FROM CommunesHV ORDER BY COMMUNE ASC"
Communes.CursorType = 0
Communes.CursorLocation = 2
Communes.LockType = 3
Communes.Open()
Communes_numRows = 0
set Categories = Server.CreateObject("ADODB.Recordset")
Categories.ActiveConnection = MM_CDT_STRING
Categories.Source = "SELECT * FROM FMA_CAT"
Categories.CursorType = 0
Categories.CursorLocation = 2
Categories.LockType = 3
Categories.Open()
Categories_numRows = 0
set FestCDT = Server.CreateObject("ADODB.Recordset")
FestCDT.ActiveConnection = MM_CDT_STRING
FestCDT.Source = "SELECT DISTINCT ID, NOM, lb_cat, PERIODE, COMMUNE FROM FMA7_HV WHERE 1=1"
SWHERE = ""
if Request.QueryString("commune") <> "" and Request.QueryString("commune") <> "99999" then
SWHERE = SWHERE + " AND COMMUNE = '" & Request.QueryString("commune") & "'"
end if
if Request.QueryString("categ") <> "" and Request.QueryString("categ") <> "99999" then
SWHERE = SWHERE + " AND id_cat = '" & Request.QueryString("categ") & "'"
end if
if Request.QueryString("nom") <> "" then
SWHERE = SWHERE + " AND NOM LIKE '%" + Replace(Request.QueryString("nom"), "'", "''") + "%'"
end if
if Request.QueryString("datedeb") <> "" AND Request.QueryString("datefin") <> "" then
SWHERE = SWHERE + " AND DAT_DEBUT <= '" + (Request.QueryString("datefin")) + "' AND DAT_FIN >= '" + (Request.QueryString("datedeb")) + "'"
else
if Request.QueryString("datefin") <> "" then
SWHERE = SWHERE + " AND DAT_DEBUT <= '" + (Request.QueryString("datefin")) + "' AND DAT_FIN >= '" + (Request.QueryString("datefin")) + "'"
else
if Request.QueryString("datedeb") <> "" then
SWHERE = SWHERE + " AND DAT_DEBUT <= '" + (Request.QueryString("datedeb")) + "' AND DAT_FIN >= '" + (Request.QueryString("datedeb")) + "'"
end if
end if
end if
FestCDT.Source = FestCDT.Source + SWHERE
FestCDT.CursorType = 0
FestCDT.CursorLocation = 2
FestCDT.LockType = 3
FestCDT.Open()
FestCDT_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
' set the record count
FestCDT_total = FestCDT.RecordCount
' set the number of rows displayed on this page
If (FestCDT_numRows < 0) Then
FestCDT_numRows = FestCDT_total
Elseif (FestCDT_numRows = 0) Then
FestCDT_numRows = 1
End If
' set the first and last displayed record
FestCDT_first = 1
FestCDT_last = FestCDT_first + FestCDT_numRows - 1
' if we have the correct record count, check the other stats
If (FestCDT_total <> -1) Then
If (FestCDT_first > FestCDT_total) Then FestCDT_first = FestCDT_total
If (FestCDT_last > FestCDT_total) Then FestCDT_last = FestCDT_total
If (FestCDT_numRows > FestCDT_total) Then FestCDT_numRows = FestCDT_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (FestCDT_total = -1) Then
' count the total records by iterating through the recordset
FestCDT_total=0
While (Not FestCDT.EOF)
FestCDT_total = FestCDT_total + 1
FestCDT.MoveNext
Wend
' reset the cursor to the beginning
If (FestCDT.CursorType > 0) Then
FestCDT.MoveFirst
Else
FestCDT.Requery
End If
' set the number of rows displayed on this page
If (FestCDT_numRows < 0 Or FestCDT_numRows > FestCDT_total) Then
FestCDT_numRows = FestCDT_total
End If
' set the first and last displayed record
FestCDT_first = 1
FestCDT_last = FestCDT_first + FestCDT_numRows - 1
If (FestCDT_first > FestCDT_total) Then FestCDT_first = FestCDT_total
If (FestCDT_last > FestCDT_total) Then FestCDT_last = FestCDT_total
End If
%>
<% ' on retrouve les paramètres de Titre et PMETA dans l'include increferencement.asp %>
<%=(Titre)%>
<%=PMETA%>
<%
rsfestif.Open()
if NOT rsfestif.EOF or NOT rsfestif.BOF then
%>