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

📄 file_index.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
typeid=request("typeid") : if typeid="" then typeid=0 '当前文件夹ID
ParentId=request("ParentId") : if ParentId="" then ParentId=0 '上级目录ID
SearchName=request("Name") '按该文件名查询文件
maxmessage=15 '每页显示记录数
currentpage=request("page") '当前页码
Search=request("Search") '上次查询条件
'------------------------------------------------
'------------------------------------------------取记录
'查寻条件
if SearchName<>"" then where="where F.Name like '%"&SearchName&"%'"  else where="where F.typeid="&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")	'取当级目录管理权限
end if
rsdir.close
set rsdir=nothing
set N_rsdir=Server.CreateObject("ADODB.RecordSet")
sql="select * from tbioaDownload_sort where pid="&typeid&" order by id desc"
N_rsdir.open sql,oConn,1,1
'------------------------------------------------
%>


<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">

<!--#include file="file_head.html"-->
<hr width="100%" size=1 color="#000000">

<br>

<table width="100%" cellpadding="2" cellspacing="1" class="tab">
  <tr bgcolor="#000000">
    <td bgcolor=#EBEBEB class="tdTop">名称</td>
    <td bgcolor=#EBEBEB class="tdTop">类别</td>
    <td bgcolor=#EBEBEB class="tdTop">大小</td>
    <td bgcolor=#EBEBEB align=center class="tdTop">发布日期</td>
    <td bgcolor=#EBEBEB align=center class="tdTop">修改日期</td>
    <td colspan="2" align=right bgcolor=#EBEBEB class="tdTop">操作</td>
  </tr>
<%while not N_rsdir.eof
%>
  <tr bgcolor="#000000">
    <td bgcolor=#EBEBEB class="td1">
      <a href="file_index.asp?Typeid=<%=N_rsdir("ID")%>&Parentid=<%=Parentid%>"><img src="../images/foldericon.gif" border="0" align="absmiddle" title="进入此目录"> <%=htmlout(N_rsdir("name"))%></a>
    </td>
    <td bgcolor=#EBEBEB class="td1" align="center">文件夹</td>
    <td bgcolor=#EBEBEB class="td1" align="center">--</td>
    <td bgcolor=#EBEBEB align=center class="td1"><%=formatdatetime(N_rsdir("sdate"),2)%></td>
    <td bgcolor=#EBEBEB align=center class="td1"><%=formatdatetime(N_rsdir("mdate"),2)%></td>
    <td bgcolor=#EBEBEB width="50" align=right class="td1" nowrap>
	<%
	if  manageAuth or returnqx("0402") then%>
	<img src="../images/icon_edit.gif" width="16" height="16" border="0" align="absmiddle"> <a href="RDownload_edit.asp?id=<%=N_rsdir("id")%>&Typeid=<%=Typeid%>&Parentid=<%=Parentid%>">修改</a>
	<%else%>
	<img border="0" src="../images/icon_edit.gif" align="left" style="filter:xray"> 修改
	<%end if%>
	</td>
    <td bgcolor=#EBEBEB width="50" align=right class="td1" nowrap>
        <%if  manageAuth or returnqx("0402") then%>
	<img src="../images/icon_dele.gif" width="16" height="16" border="0" align="absmiddle"> <a href="RDownload_dele.asp?id=<%=N_rsdir("id")%>&Typeid=<%=Typeid%>&Parentid=<%=Parentid%>">删除</a>
	<%else%>
	<img border="0" src="../images/icon_dele.gif" align="left" style="filter:xray"> 删除
	<%end if%>
    </td>
  </tr>
<%
N_rsdir.MoveNext
wend
N_rsdir.close
set N_rsdir=nothing
%>
</table>
<br>
<%
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")	'取当级目录管理权限
if (not viewAuth) and (not manageAuth) then
	response.write "没有权限查看该文件夹!"
	response.end
else
	set rs=Server.CreateObject("ADODB.RecordSet")
	sqlstr="select * from tbioaDownloadFile where Typeid="&TypeId
	rs.open sqlstr,oconn,1,1
'	Showpage=SearchPaging(rs,maxmessage,currentpage,Search)
	if rs.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>
		<% set fs=createobject("scripting.filesystemobject")
		do while not rs.eof
		%>
		  <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(rs("name")) %></font>
			<br>简介:<%if len(rs("body"))>102 then%><%=HtmlOut(left(rs("body"),100))%>...<%else%><%=HtmlOut(rs("body"))%><%end if%>
		    </td>
		    <td class="td1">
		      <%
			if fs.fileExists(server.mappath("./FILES/"&rs("url"))) then
				set f=fs.getfile(server.mappath("./FILES/"&rs("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(rs("SDate"))%></td>
		    <td align=right  class="td1"><%=HtmlOut(rs("num"))%> 次</td>
		  </tr>
		  <tr>
		    <td colspan=3></td>
		    <td colspan=5 align="right">
		      <img src=../images/icon_show.gif align="absmiddle" border=0 alt=>
		      <a href=display.asp?id=<% =rs("id") %> target="_blank">查看</a> 
		      <img src=../images/icon_close.gif align="absmiddle" border=0 alt=>
		      <a href=download.asp?id=<% =rs("id") %>>下载</a> 
		      <%if manageAuth or returnqx("0402") then%>
		      		<img src=../images/icon_edit.gif align="absmiddle" border=0 alt=>
		      		<a href="file_edit.asp?id=<%=rs("id")%>&typeid=<%=rs("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>">编辑</a> 
		      		<img src=../images/icon_dele.gif align="absmiddle" border=0 alt=>
		      		<a href="file_del.asp?id=<%=rs("id")%>&typeid=<%=rs("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>" onclick="return window.confirm('你确定要删除该文件吗?');">删除</a> 
		      <%end if%>
		    </td>
		  </tr>
		  <tr>
		    <td class="tdTop" colspan="9"></td>
		  </tr>
		<%
		rs.MoveNext
		loop
		%>

		</table>

	<%
	end if
	rs.close
	set rs=nothing
	end if
end if
rsdir.close
set rsdir=nothing%>
</body>

</html>

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

⌨️ 快捷键说明

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