<%Set OggettoFile = Server.CreateObject("Scripting.FileSystemObject")%>
<!--#include file="Inc/Connetti.inc"-->
<!--#include file="Inc/Funzioni.inc"-->
<!--#include file="Inc/GestioneDate.inc"-->
<%
Dim anno
Dim mese
Dim dataindicativa
Dim datafinale
Dim SQLCongressi
Dim RSCongressi
Dim stringacongresso
Dim SQLPdf
Dim RSPdf

stringacongresso = ""

anno = Year(Date)
mese = Month(Date)
If mese < 10 Then
	mesestr = "0" & CStr(mese)
Else
	mesestr = CStr(mese)
End If

dataindicativa = CDate(CreaDataServer(anno & mesestr & "01")) + 50
datafinale = CreaDataNostra(dataindicativa)
mesefinale = CInt(Mid(CStr(datafinale), 5,2))
'If mesefinale = 1 Then
'	mesefinale = 12
'End If
annofinale = Cint(Left(CStr(datafinale), 5))

If anno = annofinale Then
	concatenatore = "AND"
Else
	concatenatore = "OR"
End If
SQLCongressi = "SELECT * FROM Congressi WHERE (Congressi_Anno=" & anno & " AND Congressi_Mese>=" & mese & ") " & concatenatore & " (Congressi_Anno=" & annofinale & " AND Congressi_Mese<=" & mesefinale & ") ORDER BY Congressi_Anno, Congressi_Ordine;"
Set RSCongressi = ApriRecordSet(SQLCongressi)
%>
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE>
body {
	background: #E1E1E1;
	scrollbar-face-color: #E0E0E0;
	scrollbar-highlight-color: #B5B5B5; 
	scrollbar-shadow-color: #B5B5B5; 
	scrollbar-3dlight-color: #FFFFFF; 
	scrollbar-arrow-color: #999999; 
	scrollbar-track-color: #EFEFEF; 
	scrollbar-darkshadow-color: #FFFFFF;
	}
</STYLE>
<!--#include file="Inc/stili.inc"-->
</HEAD>
<BODY LINK="#CE0000" VLINK="#CE0000">
<TABLE BORDER='0' WIDTH='100%' CELLSPACING='0' CELLPADDING='0'>
<%Do While Not RSCongressi.EOF
stringacongresso = "<B>%aprelink%" & RSCongressi("Congressi_Titolo") & "%chiudelink%</B><BR>"
If RSCongressi("Congressi_Link") <> "-1" Then
	aprelink = "<A HREF='" & RSCongressi("Congressi_Link") & "' TARGET='_new'>"
	chiudelink = "</A>"
Else
	aprelink = ""
	chiudelink = ""
End If
stringacongresso = Replace(stringacongresso, "%aprelink%", aprelink)
stringacongresso = Replace(stringacongresso, "%chiudelink%", chiudelink)
If RSCongressi("Congressi_Luogo") <> "-1" Then
	stringacongresso = stringacongresso & RSCongressi("Congressi_Luogo")
End If
If RSCongressi("Congressi_Sede") <> "-1" Then
	stringacongresso = stringacongresso & ", " & RSCongressi("Congressi_Sede")
End If
If RSCongressi("Congressi_Sede") <> "-1" OR RSCongressi("Congressi_Luogo") <> "-1" Then
	stringacongresso = stringacongresso  & "<BR>"
End If
stringacongresso = stringacongresso  & RSCongressi("Congressi_Date") & "<BR>"
If RSCongressi("Congressi_Note") <> "-1" Then
	stringacongresso = stringacongresso & "<I>" & RSCongressi("Congressi_Note") & "</I>"
End If

SQLPdf = "SELECT Pdf_Pdf, Pdf_Testo FROM Pdf WHERE Pdf_CongressoID=" & RSCongressi("Congressi_CongressoID") & ";"
Set RSPdf = ApriRecordSet(SQLPdf)
If Not RSPdf.EOF Then
	Do While Not RSPdf.EOF
		stringacongresso = stringacongresso & "<A HREF='Pdf/" & RSPdf("Pdf_Pdf") & "' TARGET='_new'>" & RSPdf("Pdf_Testo") & " " & dimensionefile("Pdf/" & RSPdf("Pdf_Pdf"), 0) & "</A><BR>"
		RSPdf.MoveNext
	Loop
End If
ChiudiOggetto(RSPdf)
stringacongresso = stringacongresso
%>
	<TR><TD>
		<%=stringacongresso%>
	</TD></TR>
	<TR><TD><IMG SRC="Img/_.gif" WIDTH='1' HEIGHT='10' BORDER='0'></TD></TR>
	<%stringacongresso = ""
	RSCongressi.MoveNext
Loop%>
</TABLE>
</BODY>
</HTML>
<%
ChiudiOggetto(RSCongressi)
ChiudiOggetto(Conn)
Set OggettoFile = Nothing%>