%
sql1="select * from choose_one where id=1"
set rs1=application("conn").execute(sql1)
if not rs1.eof then
if rs1("catid")="" or rs1("subcatid")="" then
%>
<%
const forreading=1,forwriting=2,forappending=3
const tristateusedefault=-2,tristatetrue=-1,tristatefalse=0
%>
<%
currentpage=request("currentpage")
if currentpage="" then
currentpage=1
end if
set rs=server.createobject("ADODB.Recordset")
subcatid=0
sql="select caltitle,catid from calculation_details where subcatid='"&subcatid&"' order by caldate"
rs.pagesize=5
rowcount=0
rs.cursorlocation=aduseclient
rs.cursortype=adOpendynamic
rs.open sql,application("conn")
i=1
%>
<%
if not rs.eof then
rs.absolutepage=cint(currentpage)
while not rs.eof and rowcount
<%=i%> <%=rs('caltitle')%>
<% rs.movenext
rowcount=rowcount+1
i=i+1
wend
%>
<%
if rs.pagecount>1 then
for j=1 to rs.pagecount
if cint(currentpage)=j then
%>
<%=j%>
<%else%>
<%=j%>
<%
end if
next
end if
%>
<%
end if
%>
<%
else
%>
<%
subcatid=rs1("subcatid")
sql2="select * from calculation_details where subcatid='"&subcatid&"'"
set rs2=application("conn").execute(sql2)
do while not rs2.eof
%>
<%
set reader1=server.createobject("Scripting.filesystemobject")
set reader2=reader1.opentextfile(rs2("calurl"))
%>
<%=rs2("caltitle")%>
<%
while not reader2.atendofstream
%>
<%=reader2.readline%>
<%
'response.write" "
wend
%>
<%
rs2.movenext
response.write "