?? file_list.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 + -