<%if session("usr")<>0 then if request.form<>"" then response.redirect("temas.asp?c="&request.form("tema")) else%> <% if request.querystring("p")="" then session("pagina")=1 else session("pagina")=request.querystring("p") end if rstemas.open "select * from temas order by nombretema" ,conn ,adOpenKeyset ,adLockOptimistic if rstemas.recordcount<>0 then rstemas.pagesize=20 rstemas.absolutepage=session("pagina") end if %>
Biblioteca

Temas

<%if request.querystring("c")<>"" then%> <%=rstemas.recordcount%> temas encontrados con el texto "<%=request.querystring("c")%>"
<%else%> <%=rstemas.recordcount%> temas
<%end if%> Página <%=session("pagina")%> de <%=rstemas.pagecount%>
<%if request.querystring("c")<>"" then%> <%if session("pagina")>1 then%> &c=<%=request.querystring("c")%>>Anterior <%end if if rstemas.pagecount>10 then numpmax=4 else numpmax=rstemas.pagecount end if nump=1 do until nump>numpmax if nump=int(session("pagina")) then%> <%=nump%>  <%else%> &c=<%=request.querystring("c")%>><%=nump%>  <%end if nump=nump+1 loop%> <%if rstemas.pagecount>10 then%>  ...  <%nump=rstemas.pagecount-numpmax+1 do until nump>rstemas.pagecount if nump=int(session("pagina")) then%> <%=nump%>  <%else%> &c=<%=request.querystring("c")%>><%=nump%>  <%end if nump=nump+1 loop end if if int(session("pagina")) &c=<%=request.querystring("c")%>>Siguiente <%end if else if session("pagina")>1 then%> >Anterior <%end if if rstemas.pagecount>10 then numpmax=4 else numpmax=rstemas.pagecount end if nump=1 do until nump>numpmax if nump=int(session("pagina")) then%> <%=nump%>  <%else%> ><%=nump%>  <%end if nump=nump+1 loop%> <%if rstemas.pagecount>10 then%>  ...  <%nump=rstemas.pagecount-numpmax+1 do until nump>rstemas.pagecount if nump=int(session("pagina")) then%> <%=nump%>  <%else%> ><%=nump%>  <%end if nump=nump+1 loop end if if int(session("pagina")) >Siguiente <%end if end if num=(session("pagina")-1)*rstemas.pagesize+1 numt=1 do until numt>rstemas.pagesize or rstemas.eof rslibros.open "select * from libros where codtema="&rstemas("codtema") ,conn ,adOpenKeyset ,adLockOptimistic%>

<%=num%>.  ','a','scrollbars=no,height=150,width=300,status=no,toolbar=no,menubar=no,location=no');">Modificar Tema <%if rslibros.eof then%> ','a','scrollbars=no,height=150,width=300,status=no,toolbar=no,menubar=no,location=no');">Borrar Tema <%end if%> ><%=rstemas("nombretema")%> (<%=rslibros.recordcount%> libros)

<%rstemas.movenext rslibros.close num=num+1 numt=numt+1 loop rstemas.close%>
Agregar Tema


<%end if else response.redirect("salir.asp") end if%>