⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file_list.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:查看所有文件
'参数:request("typeid")=int #当前文件夹ID
%>

<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->

<%
'response.buffer=false
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
PartID=request("PartID") : if PartID="" then PartID=0 '当前文件夹ID
SearchName=request("Name") '按该文件名查询文件
maxmessage=15 '每页显示记录数
currentpage=request("page") '当前页码
Search=request("Search") '上次查询条件
currentpage=request.form("page") : if currentpage="" then currentpage=1 '当前页码
name=request.form("name")	'文件名称
F_surveyDate=request.form("F_surveyDate")
L_surveyDate=request.form("L_surveyDate")	'调查时间
body=request.form("body")	'备注
'------------------------------------------------
table="tbioaDownloadFile" '表名
'------------------------------------------------取记录
'查寻条件
if Search="" then
	Search="WHERE "
	if cint(PartID)<>0 then Search = Search & "filetype="&PartID&" and "
	if name<>""	then	Search = Search & "name LIKE '%" & name & "%' and "
	if body<>""	then	Search = Search & "body LIKE '%" & body & "%' and "
	if F_surveyDate<>"" and L_surveyDate<>"" then Search = Search & "surveyDate between "&F_surveyDate&" and "&L_surveyDate&" and "
	Search=Search & "1=1"'可查看所有人录入的记录
'	Search=Search & "userid="&LoginID'只能查看自己录入的记录
END if
'------------------------------------------------
set rspart=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " " & Search & " order by ID desc"
rspart.open sql,oConn,1,1
Showpage=SearchPaging(rspart,maxmessage,currentpage,Search)
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<base target="FrmMain">
</head>

<body topmargin="10" leftmargin="10">

<!--#include file="menu.html"-->
<hr width="100%" size=1 color="#000000">
<%=Showpage%>
<br>
<br>
<%
if rspart.RecordCount=0 then
	response.write "<BR><BR>暂时为空!"
else
%>

	<table width="100%" cellpadding="2" cellspacing="1">
	  <tr bgcolor="#000000">
	    <td bgcolor=#EBEBEB colspan="2" class="tdTop">文件介绍</td>
	    <td bgcolor=#EBEBEB class="tdTop">大小</td>
	    <td bgcolor=#EBEBEB align=center class="tdTop">发布日期</td>
	    <td bgcolor=#EBEBEB align=right class="tdTop">下载次数</td>
	  </tr>
<%
i=0
do while not rspart.eof and i<rspart.PageSize
	typeid=rspart("typeid")		
	set rsdir=Server.CreateObject("ADODB.RecordSet")
	sql="select * from tbioaDownload_sort where id="&typeid&" order by name"	
	rsdir.open sql,oConn,1,1
	if not rsdir.eof then	
		viewAuth=ReturnManage(rsdir("viewermod"),rsdir("ID"),"viewer","tbioaDownload_sort")	'取当级目录查看权限
		manageAuth=ReturnManage(rsdir("managermod"),rsdir("ID"),"manager","tbioaDownload_sort")	'取当级目录管理权限
		%>
		  <tr>
		    <td align=center class="td1" width="60"><img src=../images/system.jpg width=32 border=1></td>
		    <td class="td1"><font color="#0033CC"><% =HtmlOut(rspart("name")) %></font>
			<br>简介:<%if len(rspart("body"))>102 then%><%=HtmlOut(left(rspart("body"),100))%>...<%else%><%=HtmlOut(rspart("body"))%><%end if%>
		    </td>
		    <td class="td1">
		      <%set fs=createobject("scripting.filesystemobject")
			if fs.fileExists(server.mappath("./FILES/"&rspart("url"))) then
				set f=fs.getfile(server.mappath("./FILES/"&rspart("url")))
				if f.size<1024 then
					response.write f.size&"Bytes"
				elseif f.size<1048576 then
					response.write Round(f.size/1024.1)&"KB"
				else
					response.write Round((f.size/1024)/1024.1)&"MB"
				end if
			else
				response.write "文件不存在!"
			end if
			%>
		    </td>
		    <td align=center  class="td1"><%=HtmlOut(rspart("sdate"))%></td>
		    <td align=right  class="td1"><%=HtmlOut(rspart("num"))%> 次</td>
		  </tr>
		  <tr>
		    <td colspan=4></td>
		    <td align="right">
		      <%if viewAuth or manageAuth then%>
		      <img src=../images/p1.gif border=0 alt=> <a href=download.asp?id=<% =rspart("id") %>>下载</a> 
		      <img src=../images/p1.gif border=0 alt=> <a href=display.asp?id=<% =rspart("id") %>>查看</a>
		      <%end if%>
		      <%if manageAuth then%> 
		      <a href="manage_file_edit.asp?id=<%response.write rspart("id")%>&typeid=<%=rspart("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>">编辑</a> 
		      <a href="manage_file_del.asp?id=<%response.write rspart("id")%>&typeid=<%=rspart("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>" onclick="return window.confirm('你确定要删除该文件吗?');">删除</a> 
		      <%end if%>
		    </td>
		  </tr>
		  <tr>
		    <td class="tdTop" colspan="9"></td>
		  </tr>
		<%
	end if
	rsdir.close
	set rsdir=nothing
	rspart.movenext
	i=i+1
loop
rspart.close
set rspart=nothing
%>

</table>
<%end if%>
</body>

</html>

<%'释放对象变量
oConn.close
%> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -