📄 fl.asp
字号:
<%@language="VBScript"%>
<%option explicit%>
<!-- #include file="../include/db.inc" -->
<!-- #include file="../include/datahandle.inc" -->
<!-- #include file="f.inc" -->
<%
Dim formAction : formAction = GetParam("formAction")
Dim filetype : filetype = GetParam("filetype")
Dim itemid : itemid = GetParam("itemid")
if IsEmpty(filetype) then filetype = "all"
if IsEmpty(itemid) then itemid = "all"
Dim cn : Set cn = New CDBConnection
cn.Connect(dbLocal)
dim crs
Sub ShowFileList()
Dim rs, sSQL, sOrderby, sWhere
Dim nRows
Dim i
'-------------------------------------------
' 构造 Where 子句
'-------------------------------------------
sWhere = ""
' 按权限类别
if itemid <> "all" then
sWhere = sWhere & " and T1.item_id = " & itemid
end if
' 按文件所在路经
if filetype = "all" then
' do nothing
elseif filetype = "other" then
for i = 0 to UBound(fileTypeArray) step 1
sWhere = sWhere & " and file_name not like " & ToSQL("%"&fileTypeArray(i)&"%","Text")
next
else
sWhere = sWhere & " and file_name like '%" & filetype & "%'"
end if
'-------------------------------------------
' 构造 Order by 子句
'-------------------------------------------
sOrderby = " order by T1.item_id, file_name"
'-------------------------------------------
' 构造完整的 SQL 语句
'-------------------------------------------
sSQL = "select serial, file_name, file_desp, T1.item_id as item_id, T2.item_desp as item_desp from T_WebFiles T1, T_Item T2 " & _
" where T1.item_id = T2.item_id "
sSQL = sSQL & sWhere & sOrderby
response.write "<table cellpadding=0 cellspacing=1 bgcolor=navy>"
response.write "<tr bgcolor=""#0040a0"" style=""color:white;font-weight:600"" height=20 align=center>" & _
"<td colspan=5>"
if filetype = "all" then
response.write "所有文件"
elseif filetype="other" then
response.write "其它文件"
else
response.write filetype & " / 目录下的相关文件"
end if
response.write "</td></tr>"
response.write "<tr bgcolor=""#fefefe"">" & _
"<td class=tdHead> 文件标识 </td>" & _
"<td class=tdHead> 文件名称 </td>" & _
"<td class=tdHead> 文件描述 </td>" & _
"<td class=tdHead> 对应ItemID </td>" & _
"<td class=tdHead> Item名称 </td>" & _
"</tr>"
nRows = 0
Set crs = New CRecordSet
set rs = crs.Open(dbLocal, sSQL)
if rs.EOF then
response.write "<tr bgcolor=white height=20><td colspan=5 align=center>( 一个文件也没有!)</td></tr>"
else
while not rs.EOF
nRows = nRows + 1
response.write "<tr bgcolor=white height=20>" & _
"<td align=center> " & rs("serial") & " </td>" & _
"<td> <a href=""fm.asp?fid=" & rs("serial") & """>" & rs("file_name") & "</a> </td>" & _
"<td> " & rs("file_desp") & " </td>" & _
"<td align=center> " & rs("item_id") & " </td>" & _
"<td> " & rs("item_desp") & " </td>" & _
"</tr>"
rs.movenext
wEnd
end if
response.write "<tr bgcolor=white height=20><td colspan=5 align=right>共<font color=red><b> " & nRows & " </b></font>条记录! </td></tr>"
response.write "</table>"
rs.close
End Sub
%>
<html>
<head>
<style type="text/css">
<!-- @import url(../common/common.css); -->
.tblTitle {font-size:11pt;color:blue;background-color:#E7E7E7;border:solid;border-width:1px;border-color: white gray gray
white;text-align:center;height:30px}
</style>
</head>
<script language="VBScript">
Sub filetype_OnChange()
viewfile.formAction.value = "Show"
viewfile.itemid.value = "all"
viewfile.submit()
End Sub
Sub itemid_OnChange()
viewfile.formAction.value = "Show"
viewfile.filetype.value = "all"
viewfile.submit()
End Sub
</script>
<body>
<center>
<form method="post" name="viewfile">
<input type="hidden" name="formAction" value="<%=GetParam("formAction")%>">
<a href="fa.asp"><img border=0 src="../images/add.gif"> 新增页面文件</a>
<img border=0 src="../images/list.gif"> 路经:
<select name="filetype">
<%
Dim i
if filetype = "all" then
response.write "<option value=""all"" selected>所有</option>"
else
response.write "<option value=""all"">所有</option>"
end if
for i = 0 to UBound(fileTypeArray) step 1
if fileTypeArray(i) = filetype then
response.write "<option value='" & fileTypeArray(i) & "' selected>" & fileTypeDesp(i) & "</option>"
else
response.write "<option value='" & fileTypeArray(i) & "'>" & fileTypeDesp(i) & "</option>"
end if
next
if filetype = "other" then
response.write "<option value=""other"" selected>其它</option>"
else
response.write "<option value=""other"">其它</option>"
end if
%>
</select>
<img border=0 src="../images/list.gif"> 权限:
<select name="itemid">
<%
dim rs
if itemid = "all" then
response.write "<option value=""all"" selected>所有</option>"
else
response.write "<option value=""all"">所有</option>"
end if
set crs = New CRecordset
set rs = crs.Open(dbLocal, "select * from T_Item where has_child = 0 order by item_id")
while not rs.EOF
if itemid = rs("item_id") then
response.write "<option value=""" & rs("item_id") & """ selected>" & rs("item_desp") & "</option>" & vbLF
else
response.write "<option value=""" & rs("item_id") & """>" & rs("item_desp") & "</option>" & vbLF
end if
rs.movenext
wEnd
crs.Close()
%>
<select>
</form>
<% call ShowFileList()%>
</center>
<p align=center><a href="fa.asp"><img border=0 src="../images/add.gif"> 新增页面文件</a>
</body>
</html>
<%
cn.Disconnect()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -