%@language=vbscript codepage=936 %>
<%
const MaxPerPage=10
dim totalPut,CurrentPage,TotalPages
classid= request("classid")
strFileName="imgCaseManage.asp?classid=" & classid
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
if request("Action")="modify" then
classid= request("classid")
id= request("id")
filename= request("filename")
num= request("num")
if id<>"" then
sql="Update [filecase] set filename='"&filename&"' , num="&num&" where id=" & CLng(id)
conn.Execute sql
end if
end if
sql="select * from filecase where id>0"
sql=sql & " and classid="&request("classid")&" order by num desc,id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
| 所有 |
<%
if rs.eof and rs.bof then
response.write "共找到 0 个 |
"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
response.Write "共找到 " & totalPut & " 个 "
%>
<%
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,false,"个 "
else
if (currentPage-1)*MaxPerPage
<%
sub showContent
dim i
i=0
%>
| ID |
标题 |
图片 |
大小 |
排序 |
加入时间 |
操 作 |
<%do while not rs.eof%>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<%
end sub
%>
<%
rs.close
set rs=nothing
call CloseConn()
%>