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

📄 manage_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
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 pid="&typeid&" order by name"
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="menu1.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 rsdir.eof%>
  <tr bgcolor="#000000">
    <td bgcolor=#EBEBEB class="td1"><input type="checkbox" name="del_sign_dir" value="01">
      <a href="file_index.asp?Typeid=<%=rsdir("ID")%>"><img src="../images/foldericon.gif" border="0" align="absmiddle" title="进入此目录"></a> <%=htmlout(rsdir("name"))%>
    </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(rsdir("sdate"),2)%></td>
    <td bgcolor=#EBEBEB align=center class="td1"><%=formatdatetime(rsdir("mdate"),2)%></td>
    <td bgcolor=#EBEBEB width="50" align=right class="td1" nowrap>

	<img src="../images/icon_edit.gif" width="16" height="16" border="0" align="absmiddle"> <a href="RDownload_edit.asp?id=<%=rsdir("id")%>&Typeid=<%=Typeid%>">修改</a>
	</td>
    <td bgcolor=#EBEBEB width="50" align=right class="td1" nowrap>
	<img src="../images/icon_dele.gif" width="16" height="16" border="0" align="absmiddle"> <a href="RDownload_edit.asp?id=<%=rsdir("id")%>&Typeid=<%=Typeid%>">删除</a>
    </td>
  </tr>
<%
rsdir.MoveNext
wend
rsdir.close
%>
</table>
<br>
<%
	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 width="49" class="tdTop">大小</td>
	    <td bgcolor=#EBEBEB width="64" align=center class="tdTop">发布日期</td>
	    <td bgcolor=#EBEBEB width="60" align=right class="tdTop">下载次数</td>
	  </tr>
	<% set fs=createobject("scripting.filesystemobject") 
	   for i = 0 to rs.PageSize-1 '循环
	   If rs.EOF Then Exit For
	%>
	  <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 align=center colspan=2 align="right">
	      <img src=../images/p1.gif border=0 alt=> <a href=download.asp?id=<% =rs("id") %>>下载</a>
	      <a href="manage_file_edit.asp?id=<%response.write rs("id")%>&typeid=<%=rs("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>">编辑</a> 
	      <a href="manage_file_del.asp?id=<%response.write rs("id")%>&typeid=<%=rs("typeid")%>&page=<%=currentpage%>&Name=<%=SearchName%>" onclick="return window.confirm('你确定要删除该文件吗?');">删除</a> 
	    </td>
	  </tr>
	  <tr>
	    <td class="tdTop" colspan="5"></td>
	  </tr>
	<%
	rs.MoveNext
	next
	%>
	
	</table>
	
	<%
	rs.close
	set rs=nothing
	end if
%>
</body>

</html>

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

⌨️ 快捷键说明

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