<%
query = "SELECT * FROM nleg_news WHERE nleg_news.Data<=Now() AND nleg_news.assolo = 0 AND nleg_news.primopiano = 1"
if IDNews <> 0 then
query = query & " AND IDNews = " & IDNews
end if
query = query & " ORDER BY Data DESC LIMIT 5"
'response.write query
Set conn = CreateObject( "ADODB.Connection")
conn.Open Connstring
Set rs = conn.Execute(query)
Do While NOT rs.EOF
if IDNews = 0 then
%>
<%
end if
rs.MoveNext
Loop
rs.Close
set rs = nothing
conn.Close
set conn = nothing
%>
ARTICOLI
<%
query = "SELECT * FROM nleg_news WHERE nleg_news.Data<=Now() AND nleg_news.assolo = 1"
if IDNews <> 0 then
query = query & " AND IDNews = " & IDNews
end if
query = query & " ORDER BY Data DESC LIMIT 1"
'response.write query
Set conn = CreateObject( "ADODB.Connection")
conn.Open Connstring
Set rs = conn.Execute(query)
Do While NOT rs.EOF
if IDNews = 0 then
%>
<%
foto = rs("foto")
if foto <> "" then
linkfoto = rs("linkfoto")
if linkfoto <> "" then
%>
<%end if%><%if linkfoto <> "" then%><%end if%>
<%end if%>
<% = toItalianDate( rs("data")) %>
<%
sopratitolo = rs("SopraTitolo")
if sopratitolo <> "" then
%>
<% = sopratitolo %>
<%end if%>
"><% = rs("Titolo") %>
<% = left(rs("testo"),250)%>...
<%
end if
rs.MoveNext
Loop
rs.Close
set rs = nothing
conn.Close
set conn = nothing
%>
PROSSIMO EVENTO
<%
query = "SELECT * FROM nleg_eventi WHERE nleg_eventi.Data>=Curdate()"
if IDEvento <> 0 then
query = query & " AND IDEvento = " & IDEvento
end if
query = query & " ORDER BY Data ASC LIMIT 1"
'response.write query
Set conn = CreateObject( "ADODB.Connection")
conn.Open Connstring
Set rs = conn.Execute(query)
Do While NOT rs.EOF
if IDEvento = 0 then
%>
<%
foto = rs("immagine")
if foto <> "" then
linkfoto = rs("linkimmagine")
if linkfoto <> "" then
%>
<%end if%><%if linkfoto <> "" then%><%end if%>
<%end if%>
<% = toItalianDate( rs("data")) %> "><% = rs("Titolo") %>
<% = left(rs("descrizione"),280)%>...
<%
end if
rs.MoveNext
Loop
rs.Close
set rs = nothing
conn.Close
set conn = nothing
%>
GLI ASSOCIATI DICONO...
<%
query = "SELECT * FROM nleg_dicono WHERE Data<=Now()"
if iddicono <> 0 then
query = query & " AND iddicono = " & iddicono
end if
query = query & " ORDER BY Data DESC LIMIT 3"
'response.write query
Set conn = CreateObject( "ADODB.Connection")
conn.Open Connstring
Set rs = conn.Execute(query)
I=1
Do While NOT rs.EOF
if I>2 then
exit do
end if
if iddicono = 0 then
%>