<%
Dim oConn, RS, mostrar, pag_totales, pag_actual
'Conectamos a la BD.
fecha_actual = Now
fecha_inicio = CDate("12/03/2001")
dias_ant = DateDiff ("d", fecha_inicio, fecha_actual)
Response.Write("
Cartas anteriores: " & dias_ant & "")
Set oConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
oConn.Open "w00294862_bd1"
sql = "SELECT * FROM ffcards WHERE Id1<="&dias_ant&""
'sql = "SELECT * FROM ffcards WHERE dia='"&hoy&"'"
'sql = "SELECT * FROM discusion WHERE IdCabeza=0 ORDER BY Fecha DESC"
RS.Open sql, oConn,3,1
mostrar = 10
rs.PageSize = mostrar
rs.CacheSize = mostrar
if Request.Querystring("pagina")="" then
pag_actual=1
else
pag_actual=CInt(Request.Querystring("pagina"))
end if
pag_totales = rs.PageCount
if pag_actual < 1 then
pag_actual = 1
end if
if pag_actual > pag_totales then
pag_actual = pag_totales
end if
if pag_totales=0 then
Response.Write("No hay mensajes en el foro.")
else
rs.AbsolutePage = pag_actual
Response.Write "
"
Response.Write("Página " & Pag_actual & " de " & pag_totales &"
")
cant_registros = 0
Response.Write " | "
if pag_actual > 1 then
Response.Write("Cartas nuevas ")
end if
if pag_actual < pag_totales then
Response.Write("Cartas anteriores
")
end if
%>
|
| Carta |
Resp |
Dia |
<%do while not rs.EOF and cant_registros < mostrar
fecha = RS("dia")%>
| ID:<%=(RS.Fields("Id1"))%> | <%=(RS.Fields("final"))%> " CLASS="P" target="_blank"><%=(RS.Fields("nombre"))%> |
<% Response.Write " ["&RS("total")&"] | " &Day(fecha)&"/"&Month(fecha)&"
|
"
cant_registros = cant_registros +1
RS.MoveNext
Loop
end if
RS.Close
oConn.Close
Set RS = nothing
Set oConn = nothing
%>