?? search_list.asp
字號:
<%
'功能:檔案目錄列表
'作者:展亮
'日期:2004-6-5 23:20
%>
<!--#include file="../inc/NoCatch.asp"-->
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<!--#include file="./inc/flt.asp"-->
<%
'response.buffer=false
'------------------------------------------------設(shè)置參數(shù)
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '當(dāng)前用戶ID
maxmessage=20 '每頁顯示記錄數(shù)
currentpage=request("page") '當(dāng)前頁碼
Search=request("Search") '上次查詢條件
'------------------------------------------------
'------------------------------------------------
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<script language="javascript">
function folderin(flh)
{
if(parent.left.div_tree.style.display!='none'){
parent.left.openBranch(flh,parent.left.foldersTree);
parent.left.dfwh(flh);
}else{
window.location="?flh="+flh;
}
}
function xzfl(flh)
{
if((flh.length)>=20){
alert("當(dāng)前分類級數(shù)已為10級,不能再新增分類");
}else{
window.location="dir_add.asp?sjflh="+flh;
}
}
function delcheck()
{var j,k
j=0
k=0
for (var i=0;i<form_del.elements.length;i++)
{
var e = form_del.elements[i];
if (e.checked!=false)
{
if (e.name=="del_sign_fl"){
k=k+1;}
j=j+1;}
}
if (j==0){
alert("請選擇要刪除的文檔或類目");
}
else
{
if (k!=0)
{ if (confirm('您要刪除的對象包括分類,此分類下的子分類和文檔都將被刪除,確實要刪除么?'))
{document.form_del.action="dir_del.asp";
document.form_del.submit();}
}
else
{ if (confirm('所選中的文檔都將被刪除,確實要刪除么?'))
{document.form_del.action="dir_del.asp";
document.form_del.submit();}
}
}
}
</script>
<SCRIPT language=javascript>
function WindowOpen(strURL){
DocumentWin = window.open(strURL,"","toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
DocumentWin.focus();
}
</SCRIPT>
</head>
<body topmargin="0" leftmargin="0">
<%dim rs,sql,sjflh
sjflh=Request.QueryString("flh")
if sjflh="" then sjflh="0"
Sort_Manage=Return_Sort_Manage(GetTableValue("tbioaDocument_Sort","GLQXBZ","FLH",sjflh),"FLH",sjflh,"GLQX","tbioaDocument_Sort")
%>
<div style="font: bold 14px/20px; color: #ffffff; background-color: #2951AD; width: 100%; padding-top: 2px; padding-Left: 10px; margin-bottom:5px;">文檔管理</div>
<table width="98%" class="tabletoolbar" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td align="left"><%call flt(sjflh,"search_list.asp")%></td>
<td align="right" nowrap valign="top">
<%if Sort_Manage then%>
<input type="button" class="button0" onmouseout=className="button0" onmouseover=className="button1" value="新增分類" onclick="javascript:xzfl('<%=sjflh%>')">
<input type="button" class="button0" onmouseout=className="button0" onmouseover=className="button1" value="刪除" onclick="javascript:delcheck()">
<%end if%>
</td>
</tr>
</table>
<table width="98%" cellspacing="1" cellpadding="2" class="tab" align="center">
<form method="post" name="form_del">
<input type="hidden" name="sjflh" value="<%=sjflh%>">
<tr class="tdTop">
<td align="center" nowrap>名稱</td>
<td align="center" width="70" nowrap>類別</td>
<td align="center" width="120" nowrap>修改日期</td>
<%if Sort_Manage then%>
<td align="center" width="50" nowrap>處理</td>
<%end if%>
</tr>
<%
if sjflh="0" or sjflh="00" then
sql="select * from tbioaDocument_Sort where sjflh='0' or sjflh='00'"
else
sql="select * from tbioaDocument_Sort where sjflh='"&sjflh&"'"
end if
set rs=oConn.execute(sql)
if not rs.eof and not rs.bof then
do while not rs.eof
%>
<tr>
<td class="td1" nowrap>
<%if Sort_Manage then%><input type="checkbox" name="del_sign_fl" value="<%=rs("flh")%>" <%if rs("SCQXBZ")="0" or GetTableNum("vioaDocument_File","Where FLH='"&rs("flh")&"'") or GetTableNum("tbioaDocument_Sort","Where SJFLH='"&rs("flh")&"'") then response.write "disabled"%>><%end if%><img border="0" src="../images/dir.gif">
<a href="javascript:folderin('<%=rs("flh")%>')" title="進(jìn)入此分類"><%=server.HTMLEncode(rs("lmmc"))%></a>
</td>
<td class="td1" align="center" nowrap>文件夾</td>
<td class="td1" align="center" nowrap><%=rs("zhxgsj")%></td>
<%if Sort_Manage then%>
<td class="td1" align="center" nowrap>
<%if rs("SCQXBZ")="1" then%>
<a href="dir_edit.asp?flh=<%=rs("flh")%>" title="修改類目信息">
<img src="../images/icon_edit.gif" border="0" alt="修改" align="left">修改</a>
<%else%>
<div disabled><img border="0" src="../images/icon_edit.gif" align="left" style="filter:xray"> 修改</div>
<%end if%>
</td>
<%end if%>
</td>
</tr>
<%rs.movenext
loop
end if
'-------------------------------------------------------------
if Search="" then
Search="WHERE "
Search=Search & "FLH='" & sjflh & "'"
END if
Where=Search & " AND ((CXQXBZ = '0') OR"_
&" (CXQXBZ = '1') AND (',' + CAST(CXQX AS varchar(8000)) + ',' LIKE '%," & session("DepID") & ",%') OR"_
&" (ID IN (SELECT b.ID"_
&" FROM (SELECT ID FROM tbioaRole WHERE (',"& GetTableValue("tbioauser","RoleID","ID",LoginID) &",' LIKE '%,' + CAST(ID AS varchar) + ',%')) a INNER JOIN"_
&" (SELECT ID, FLH, CXQX FROM vioaDocument_File WHERE CXQXBZ = '2') b"_
&" ON ',' + CAST(b.CXQX AS varchar(8000)) + ',' LIKE '%,' + CAST(a.id AS varchar) + ',%')))"
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from vioaDocument_File " & Where & " order by ID desc"
rs.open sql,oConn,1,1
Showpage=Paging(rs,maxmessage,currentpage,"Search="&Server.URLencode(Search)&"&FLH="&sjflh)
%>
<tr><td class="tdBottom" nowrap colspan="5"> 文件列表:<%=Showpage%> </td></tr>
<%
for i = 0 to rs.PageSize-1
If rs.EOF Then Exit For
%>
<tr>
<td class="td1" nowrap>
<%if Sort_Manage then%><input type="checkbox" name="del_sign_da" value="<%=rs("ID")%>" <%if rs("File_Save")>=date then response.write "disabled"%>><%end if%><img border="0" src="../images/document.gif">
<%if not rs("ZFBZ") then%>
<%if rs("type")="doc" then%>
<a href="javascript:WindowOpen('../Documents/DocumentShow.asp?RecordID=<%=rs("RecordID")%>');" title="查看文檔信息"><%=server.HTMLEncode(rs("Subject"))%></a>
<%else%>
<a href="<%=rs("RecordID")%>" target="_blank" title="查看文檔信息"><%=server.HTMLEncode(rs("Subject"))%></a>
<%end if%>
<%else%>
<span disabled><strike><%=server.HTMLEncode(rs("Subject"))%></strike> (作廢)</span>
<%end if%>
</td>
<td class="td1" align="center" nowrap>文檔文件</td>
<td class="td1" align="center" nowrap><%=rs("File_Date")%></td>
<%if Sort_Manage then%>
<td class="td1" align="center" nowrap>
<%if rs("type")="doc" then%>
<a href="Document_File_Gd_S.asp?RecordID=<%=rs("RecordID")%>" title="修改文檔信息">
<img src="../images/icon_edit.gif" border="0" align="left">修改</a>
<%else%>
<a href="dele.asp?ID=<%=rs("ID")%>" title="刪除文檔信息">
<img src="../images/icon_dele.gif" border="0" align="left">刪除</a>
<%end if%>
</td>
<%end if%>
</tr>
<%
rs.movenext
next
rs.close
set rs=nothing
oConn.close
set oConn=nothing
%>
</table>
</form>
</body>
</html>
<%
''''''''''''''''''''''返回當(dāng)前用戶是否有操作權(quán)限'''''''''''''''''''''
Function Return_Sort_Manage(managemod,AField,ArchivesID,SField,STable)
''''''''''''''''''''''列表類型,id號,查找字段,查找表名
'返回用戶是否有管理/查看權(quán)限
dim i
if ArchivesID<>"" and IsNumeric(ArchivesID) then
select case managemod '管理/查看列表類型 0:所有用戶 1:部門2:職務(wù)
case "0"
Return_Sort_Manage=true
case "1"
TmpSQL="select "&SField&" from " & STable & " where "&AField&"='"&ArchivesID&"'" '取得管理/查看權(quán)限
set TmpRS=Server.CreateObject("ADODB.RecordSet")
TmpRS.open TmpSQL,oconn,1,1
if TmpRS.eof then
TmpRS=close
set TmpRS=nothing
Return_Sort_Manage=false
else
ManageStr=TmpRS(SField)
TmpRS.close
set TmpRS = nothing
if len(ManageStr)>0 then
if Instr(1,","&ManageStr&",",","&session("DepID")&",", 1)>0 then '判斷管理/查看權(quán)限中是否包含有當(dāng)前用戶部門ID
Return_Sort_Manage=true
else
Return_Sort_Manage=false
end if
else
Return_Sort_Manage=false
end if
end if
case "2"
TmpSQL="select "&SField&" from " & STable & " where "&AField&"='"&ArchivesID&"'" '取得管理/查看權(quán)限
set TmpRS=Server.CreateObject("ADODB.RecordSet")
TmpRS.open TmpSQL,oconn,1,1
if TmpRS.eof then
Return_Sort_Manage=false
else
ManageStr=TmpRS(SField)
TmpRS=close
TmpSQL="select roleID from tbioaUser where id="&session("LoginID") '取得當(dāng)前用戶職務(wù)
set TmpRS=Server.CreateObject("ADODB.RecordSet")
TmpRS.open TmpSQL,oconn,1,1
if TmpRS.eof then
TmpRS.close
set TmpRS=nothing
Return_Sort_Manage=false
else
RoleArr=split(TmpRS("RoleID"),",")
TmpRS.close
set TmpRS=nothing
Return_Sort_ManageR=false
for i=0 to UBound(RoleArr)
if instr(1,","&ManageStr&",",","&RoleArr(i)&",")>0 then '判斷管理/查看權(quán)限中是否包含有當(dāng)前用戶職務(wù)
Return_Sort_ManageR=true
end if
next
Return_Sort_Manage=Return_Sort_ManageR
end if
end if
case else
Return_Sort_Manage=false
end select
else
Return_Sort_Manage=false
end if
end Function
'-----------------------------------------------------------
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -