<html>
<head>
<title>News by Osato Ivan</title>
</head>
<link href="css/styles.css" rel="stylesheet" type="text/css">
<body>
<p align="center"><font face="Verdana" color="#748aa5">Amministrazione News</font></p>
<%
SQL = "SELECT id,titolo,data FROM tblNews Order by data desc"
Set rs = Server.CreateObject("ADODB.Recordset")
Set rs = conn.Execute(SQL)
' controllo la presenza o meno dei record
if rs.eof then
%>
<table border="0" cellpadding="0" cellspacing="0" width="80%" align="center">
<tr>
<td align="center" class="error">Nessuna News trovata in Archivio!!!
[img]images/nonesiste.gif[/img]</td>
</tr>
</table>
<%
else
%>
<table border="0" cellpadding="1" cellspacing="1" width="80%" align="center">
<tr>
<td align="center" colspan="5" class="t_title">Totale News : <%=Totalenews()%> </td>
</tr>
<%
Do while not rs.eof
%>
<tr>
<td width="5%" align="center" class="t_top">[img]images/pm.gif[/img]</td>
<td width="5%" align="center" class="t_top"><a href="modifica_news.asp?id=<%=rs("id")%>">[img]images/Modifica.gif[/img]"></td>
<td width="5%" align="center" class="t_top"><a href="cancella_news.asp?id=<%=rs("id")%>">[img]images/Cancella.gif[/img]"></td>
<td width="25%" align="center" class="t_top"><%=rs("data")%></td>
<td width="50%" class="t_top">
"><%=rs("titolo")%></td>
</tr>
<%
rs.movenext
loop
end if
rs.Close
Set rs = Nothing
%>
<tr>
<td align="center" colspan="5" class="t_title">
Inserisci News</td>
</tr>
</table>
</body>
</html>
<%
Function TotaleNews()
dim SQL,rs
SQL = "Select id From tblNews"
Set rs=Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.Open SQL, conn, ,-1
TotaleNews = rs.recordcount
rs.Close
Set rs = Nothing
End Function
%>