📄 jsindex.asp
字号:
<%@ language=vbscript %>
<!--#include file="conn.asp"-->
<%
scnb1=request("scnb")
dm=request("dm")
ckdm=dm
if Session.Contents("dm")=dm or Session.Contents("gws")=true then
Dim sColor
set rs=server.createobject("adodb.recordset")
j=request("j")
jsd=request("jsd")
myjl=request("myjl")
jlh=request("jlh")
if jlh="" then
jlh=1
end if
if jlh=1 then
sql="select * from cxb where cknb='教师共享' Order by scnb,scdm"
elseif jlh=3 then
sql="select * from cxb where cknb='教师共享' Order by rq"
elseif jlh=4 then
sql="select * from cxb where cknb='教师共享' Order by nb"
end if
rs.open sql,conn,1,1
total=rs.recordcount
if not isnumeric(request("page")) or isempty(request("page")) then
page=1
else
page=int(abs(request("page")))
end if
if myjl=0 then
myjl=10
end if
rs.pagesize=myjl
mypagesize=rs.pagesize
if total<>0 then
rs.absolutepage=page
end if
%>
<html>
<head>
<title>文件管理系统--龚文生</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../config.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" background="../bg01.gif">
</p>
<center>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div align="center"><b><font color=red face="华文行楷" size="6">文件管理窗口</font></b></div>
<center>
每页显示:
<a href='jsindex.asp?dm=<%=dm%>&myjl=<%=10%>'>10条</a>
<a href='jsindex.asp?dm=<%=dm%>&myjl=<%=20%>'>20条</a>
<a href='jsindex.asp?dm=<%=dm%>&myjl=<%=50%>'>50条</a>
<a href='jsindex.asp?dm=<%=dm%>&myjl=<%=100%>'>100条</a>
<a href='jsindex.asp?dm=<%=dm%>&myjl=<%=total%>'>全部</a>
</center>
<p>
<div align="center"><b><font color="#0066FF">(目前共有文件<font color=red><%=total%></font>个,欢迎你查询管理)
</font></b></div>
</td>
</tr>
</table>
<%
Response.Write("<center>")
Response.Write("<table border=1 cellpadding=1 cellspacing=1>")
Response.Write("<tr bgcolor=aaaaaa style='color:black;'>")
Response.Write("<td align=center>编号</td>")
Response.Write("<td align=center>文件名</td>")
Response.Write("<td align=center><a href='jsindex.asp?jlh=4&myjl="&myjl&"&dm="&dm&"'>分类</a></td>")
Response.Write("<td align=center><a href='jsindex.asp?jlh=1&myjl="&myjl&"&dm="&dm&"'>发送类</a></td>")
Response.Write("<td align=center>发送者</td>")
Response.Write("<td align=center>大小</td>")
Response.Write("<td align=center><a href='jsindex.asp?jlh=3&myjl="&myjl&"&dm="&dm&"'>上传日期</a></td>")
Response.Write("<td align=center>说明</td>")
Response.Write("<td align=center>下载浏览</td></tr>")
dim i
i=1
do while not rs.eof and mypagesize>0 '----------这里的mypagesize>0不能丢,它是跳出循环的判断条件
bh=rs("bh")
dx=rs("dx")
nb=rs("nb")
scnb=rs("scnb")
scdm=rs("scdm")
cknb=rs("cknb")
ckdm=rs("ckdm")
wjm=rs("wjm")
sm=rs("sm")
rq=rs("rq")
If sColor = "silver" Then
sColor = "#cccccc"
Else
sColor = "silver"
End If
Response.Write("<tr bgcolor='" & sColor & "'>")
%>
<td align=center><font color="red"><%=i+(page-1)*rs.pagesize%></font></td>
<td align=center><%=wjm%></td>
<td align=center><%=nb%></td>
<td align=center><%=scnb%></td>
<td align=center><%=scdm%></td>
<td align=right><%=dx%>KB</td>
<td align=center><%=rq%></td>
<td align=center>
<a href="#" onClick="window.open('wjck.asp?bh=<%=bh%>', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=610,height=400,left=0,top=0')">
<font color="blue">查看</font></a></td>
<td align=center>
<%
If nb = "视频" Then
%>
<a href="#" onClick="window.open('open.asp?bh=<%=bh%>', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=484,height=455,left=0,top=0')">
视频播放</a>
<%
Else
%>
<a target="_blank" href="<%=bh%>">下载浏览</a>
<%
End If
%>
</td></tr>
<%
mypagesize=mypagesize-1 '-------------设定为10 这样只能循环10 次 减为0时跳出循环
i=i+1
rs.movenext
loop
'-------------------显示记录到此结束
Response.Write("</table><br><br>")
Response.Write("</center>")
%>
<table width="100%" border="0" align="center">
<tr>
<td>
<div align="center">页数:
<%
if page>2 then '-------------------如果是在第2页以后则 显示首页
%>
<a href=jsindex.asp?dm=<%=dm%>&page=<%=1%>&jlh=<%=jlh%>&myjl=<%=myjl%>>首页</a>
<%
end if
%>
<%
if page>10 then '-------------------如果是在第11页以后则 显示上10页
%>
<a href=jsindex.asp?dm=<%=dm%>&page=<%=page-10%>&jlh=<%=jlh%>&myjl=<%=myjl%>>前10页</a>
<%
end if
%>
<%
if page>1 then '-------------------如果是在第一页以后则 显示上一页
%>
<a href=jsindex.asp?dm=<%=dm%>&page=<%=page-1%>&jlh=<%=jlh%>&myjl=<%=myjl%>>上一页</a>
<%
end if
%>
<%
if rs.pagecount<=10 then '---------------如果总共分页数少于或等于10页 则只用12345678910显示
for j=1 to rs.pagecount
response.write "[<a href=jsindex.asp?page="&j&"&jlh="&jlh&"&myjl="&myjl&"&dm="&dm&">"&j&"</a>]"
next
else '----------------如果多于10页 则前10页用12345678910标出
jsj=page
if jsj>rs.pagecount-10 then
jsd=rs.pagecount
else
jsd=jsj+9
end if
for j=jsj to jsd
response.write "[<a href='jsindex.asp?page="&j&"&jlh="&jlh&"&myjl="&myjl&"&dm="&dm&"'>"&j&"</a>] "
next
if page<rs.pagecount-9 then
response.write "[<a href='jsindex.asp?page="&rs.pagecount&"&jlh="&jlh&"&myjl="&myjl&"&dm="&dm&"' title='最后一页'>尾页</a>]"
end if
end if
'-------------最后一页
%>
<%
if page<rs.pagecount then%>
<a href='jsindex.asp?dm=<%=dm%>&page=<%=page+1%>&jlh=<%=jlh%>&myjl=<%=myjl%>'>下一页</a>
<%
end if
%>
</div>
</td>
</tr>
</table>
<form name="form2" method="post" action="jsfind.asp?myjl=<%=myjl%>&dm=<%=dm%>&scnb1=<%=scnb1%>">
<table width="100%" border="0" align="center" height="37">
<tr>
<td height="42">
<div align="center">
<select name="topic">
<option value="1">按文件名搜</option>
<option value="2">按分类搜</option>
<option value="3">按发送者搜</option>
<option value="4">按发送类搜</option>
<option value="0" selected>智能搜索</option>
</select>
关键词:
<input type="text" name="key" size="20">
<input type="submit" name="Submit2" value="搜索">
</div>
</td>
</tr>
</table>
<center>
<p>搜索之后可对搜索到的文件进行修改或删除</p>
<font size="2">
jpg/gif/jpeg/txt/bmp/htm/html格式的文件可直接浏览</font>
<br>
<font size="2">
rar/zip/doc/xls/ppt格式的文件下载</font></p>
</center>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
else
%>
<body text="#000000" background="bg01.gif">
<p align="center">请重新登录!
<%
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -