📄 file_l.asp
字号:
<%
'************************************************************************************************
' 文件名: file_l.asp
' Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
' 创建人 : 周秋舫
' 日 期 : 2002-08-16
' 修改历史 :
' ****年**月**日 ****** 修改内容:**************************************************
' 功能描述 : 显示文件列表
' 版 本 :
'************************************************************************************************
option explicit
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- #include file="../include/config.inc" -->
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/debug.inc" -->
<!-- #include file="../include/db.inc" -->
<!-- #include file="../include/emp.inc" -->
<!-- #include file="../include/date.inc" -->
<!-- #include file="../include/datahandle.inc" -->
<!-- #include file="../include/recordlist.inc" -->
<!-- #include file="../include/security.inc" -->
<!-- #include file="../common/commonpage.inc" -->
<!-- #include file="file.inc" -->
<!-- #include file="file_l.inc" -->
<%
call CheckSecurity()
'********************************************************************************************************
'' 获取或定义各种参数值
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim iEmpSerial : iEmpSerial = GetEmpSerial '' 我自己的员工序列号
dim pFileFolder : pFileFolder = GetParam("filefolder") '' 指定文件夹,无该参数表示所有文件夹,0表示根目录,其他表示指定目录
dim pShare : pShare = GetParam("sharefile") '' 0 表示我自己共享的,1表示其它人共享的
dim pEmpSerial : pEmpSerial = GetParam("emp_serial") '' 指定某个员工共享给我的文件
Const SHARE_OF_MINE = "1" '' 我共享给其他人的文件
Const SHARE_OF_OTHERS = "2" '' 其它人共享给我的文件
'********************************************************************************************************
' 分页相关的变量定义
'-------------------------------------------------------------------------------------------------------------------------------------------------
Dim sSQL, sWhere, sOrderby
Dim sFileName : sFileName = "file_l.asp"
Dim iTotalRecords : iTotalRecords = 0 ' 分页
Dim iRecordsPerPage : iRecordsPerPage = 20
Dim iTotalPages : iTotalPages = 0
Dim iCols : iCols = 4
Dim iCurrentPage : iCurrentPage = GetParam("Page")
Dim iSort : iSort = GetParam("Sorting")
Dim iSorted : iSorted = GetParam("Sorted")
Dim sSortParams : sSortParams = ""
Dim sFormParams : sFormParams = ""
Dim sDirection : sDirection = ""
sFormParams = "filefolder=" & pFileFolder & "&sharefile=" & pShare & "&"
'********************************************************************************************************
' 构造分页的SQL语句
'-------------------------------------------------------------------------------------------------------------------------------------------------
sSQL = "select * from T_Files"
sOrderby = " order by filename"
'********************************************************************************************************
'' 构造查询限制条件
'-------------------------------------------------------------------------------------------------------------------------------------------------
if IsEmpty(pFileFolder) then
'' 如果没有文件夹限制,则可能是我的文档或我的共享文档或其他人的共享文档,就看有没有sharefile参数
if IsEmpty(pShare) then '' 我的文档(所有文档,包括根目录和各子目录的所有文档)
sWhere = " where emp_serial = " & iEmpSerial
elseif CStr(pShare) = SHARE_OF_MINE then '' 我共享给别人的文件
sWhere = " where emp_serial = " & iEmpSerial & " and opento is not null"
else
if IsEmpty(pEmpSerial) then '' 所有别人共享给我的文件
sWhere = " where emp_serial <> " & iEmpSerial & " and PATINDEX('%," & iEmpSerial & ",%', ','+replace(opento,' ','')+',') >0"
else '' 指定的人共享给我的文件
sWhere = " where emp_serial = " & pEmpSerial & " and PATINDEX('%," & iEmpSerial & ",%', ','+replace(opento,' ','')+',') >0"
end if
end if
elseif CStr(pFileFolder) = "0" then
'' 我的在根目录中的文档
sWhere = " where emp_serial = " & iEmpSerial & " and folder is null"
else
'' 我的在指定目录中的文档
sWhere = " where emp_serial = " & iEmpSerial & " and folder = " & pFileFolder
end if
'********************************************************************************************************
' 分页SQL语句构造完毕,调用PrepareListData进行分页前的变量准备
'-------------------------------------------------------------------------------------------------------------------------------------------------
dim arrayFields(3), sDelimiter
sDelimiter = "*"
arrayFields(0) = "filename"
arrayFields(1) = "filesize"
arrayFields(2) = "filetype"
arrayFields(3) = "upload_time"
'arrayFields(1) = "subject"
call PrepareListData(sSQL & sWhere & sOrderby, Join(arrayFields, sDelimiter), sDelimiter)
'********************************************************************************************************
%>
<html>
<head>
<title>上海信息大楼 Shanghai Information Tower</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../common/common.css" type="text/css">
<style>
<!--
.skin0 { position:absolute; cursor:default; width:200px; background-color:menu; font-family:Verdana; visibility:hidden;}
.skin1 {position:absolute; cursor:default; font-family: Arial, Helvetica, sans-serif; font-size: 9pt; width:120px; background-color:menu;
visibility:hidden; }
.menuitems { font-size:9pt; padding-left:5px; padding-right:10px; padding-top:3px; padding-bottom:3px; width:120}
-->
</style>
<script language="javascript" src="rbmenu.js"></script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg/bg0.jpg">
<br>
<%
Response.Write OuterTableHeader
Response.Write HeaderWithMenu
Response.Write InnerTableHeader
'********************************************************************************************************
' 主体从这里开始
'-------------------------------------------------------------------------------------------------------------------------------------------------
'Response.Write TableSearch
Response.Write _
"<table cellspacing=1 cellpadding=0 style=""table-layout:fixed"" bgcolor=silver>" & vbLF & _
"<tr bgcolor=white>" & vbLF & _
"<td width=130 valign=top>" & vbLF & _
"<div height=20><button style=""font-size:9pt;border-width:1px;text-align:left;width:100%""> 我的文件夹</button></div>" & vbLF & _
"<div style=""width:100%; height:380; overflow: auto;"">" & TableFolders & "</div>" & vbLF & _
"</td>" & vbLF & _
"<td width=""*"" valign=top>" & vbLF & _
"<div height=20 style=""border-width:0"">" & TableHeader & "</div>" & vbLF & _
"<div style=""width:100%; height:380; overflow: auto;border-width:0"">" & vbLF & _
TableRecords(sSQL & sWhere & sOrderby, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams ) & _
"</div>" & vbLF & _
"</td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
Response.Write TableLink
'-------------------------------------------------------------------------------------------------------------------------------------------------
' 主体到这里结束
'********************************************************************************************************
Response.Write InnerTableTailer
Response.Write Footer
Response.Write OuterTableTailer
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -