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

📄 searched.asp

📁 OFFICE办公自动化
💻 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
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
maxmessage=20 '每页显示记录数
currentpage=request("page") '当前页码
Search=request("Search") '上次查询条件
'------------------------------------------------
'------------------------------------------------取记录
'分页取记录 (返回rs对象)
'rs.recordcount 为记录总数
'rs.PageSize 为本页记录数
'
'接受查询参数
FLH=Trim(Request("FLH"))'分类号
FLH_Mod=Trim(Request("FLH_Mod"))'是否搜索下级目录
DocMod=Trim(Request("DocMod"))'收发文
DocFileNo=Trim(Request("DocFileNo"))'文号包含
Subject=Trim(Request("Subject"))'标题包含
DC_Doc_Sort=Trim(Request("DC_Doc_Sort"))'报表类别
DC_Doc_Security=Trim(Request("DC_Doc_Security"))'报表密级
File_Date=Request("File_Date")'归档日期
File_Date_end=Request("File_Date_end")'归档日期(结束)
File_Save=Request("File_Save")'保存日期
File_Save_end=Request("File_Save_end")'保存日期(结束)

'查寻条件
if Search="" then
	Search="WHERE "
	if FLH<>"" then
		if FLH_Mod<>"" then
			Search=Search & "FLH like '"&FLH&"%' AND "
		else
			Search=Search & "FLH = '"&FLH&"' AND "
		end if
	end if
	if DocMod<>"" then Search=Search & "DocMod = '"&DocMod&"' AND "
	if DocFileNo<>"" then Search=Search & "DocFileNo Like '%"&DocFileNo&"%' AND "
	if Subject<>"" then Search=Search & "Subject Like '%"&Subject&"%' AND "
	if DC_Doc_Sort<>"" then Search=Search & "DC_Doc_Sort = '"&DC_Doc_Sort&"' AND "
	if DC_Doc_Security<>"" then Search=Search & "DC_Doc_Security = '"&DC_Doc_Security&"' AND "
	if File_Date<>""	then	Search = Search & "File_Date>='" & cdate(File_Date) & "' and "
	if File_Date_end<>""	then	Search = Search & "File_Date<='" & cdate(File_Date_end) & "' and "
	if File_Save<>""	then	Search = Search & "File_Save>='" & cdate(File_Save) & "' and "
	if File_Save_end<>""	then	Search = Search & "File_Save<='" & cdate(File_Save_end) & "' and "
	Search=Search & "1=1"
END if
'select ','+roleid+',' from tbioauser where id=" & LoginID& "
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 tbioaDocument_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 tbioaDocument_File " & Where & " order by ID desc"
rs.open sql,oConn,1,1
Showpage=Paging(rs,maxmessage,currentpage,"Search="&Server.URLencode(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 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">

<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">查询结果列表:<%=Showpage%></td>
		<td align="right" nowrap valign="top">
			<input type="button" class="button0" onmouseout=className="button0" onmouseover=className="button1" value="删除" onclick="javascript:delcheck()">
		</td>
	</tr>
</table>

<table width="98%" cellspacing="1" cellpadding="2" class="tab" align="center">
<form method="post" name="form_del">
	<tr class="tdTop">
		<td align="center" nowrap>文号</td>
		<td align="center" nowrap>名称</td>
		<td align="center" width="70" nowrap>类别</td>
		<td align="center" width="120" nowrap>修改日期</td>
		<td align="center" width="50" nowrap>处理</td>
	</tr>
<%
for i = 0 to rs.PageSize-1
  If rs.EOF Then Exit For
  Sort_Manage=Return_Sort_Manage(GetTableValue("tbioaDocument_Sort","GLQXBZ","FLH",rs("FLH")),"FLH",rs("FLH"),"GLQX","tbioaDocument_Sort")
%>
<tr>
	<td class="td1" nowrap><%=rs("DocFileNo")%></td>
	<td class="td1" nowrap>
	  <input type="checkbox" name="del_sign_da" value="<%=rs("ID")%>" <%if not Sort_Manage or rs("File_Save")>=date then response.write"disabled"%>><img border="0" src="../images/document.gif">
	  <%if not rs("ZFBZ") then%>
		  <a href="javascript:WindowOpen('../Documents/DocumentShow.asp?RecordID=<%=rs("RecordID")%>&GZDBH=<%=rs("GZDBH")%>');" title="查看文档信息"><%=server.HTMLEncode(rs("Subject"))%></a>
	  <%else%>
		  <span disabled><strike><%=server.HTMLEncode(rs("Subject"))%></strike> (作废)</span>
	  <%end if%>
	</td>
	<td class="td1" align="center" nowrap><%=GetTableValue("tbioaOffice_Document_Sort","doc_sort","id",rs("DC_Doc_Sort"))%></td>
	<td class="td1" align="center" nowrap><%=rs("File_Date")%></td>
	<td class="td1" align="center" nowrap>
	<%if Sort_Manage then%>
	  <a href="Document_File_Gd_S.asp?RecordID=<%=rs("RecordID")%>" title="修改文档信息">
	  <img src="../images/icon_edit.gif" border="0" align="left">修改</a>
	<%else%>
	  <div disabled><img border="0" src="../images/icon_edit.gif" align="left" style="filter:xray"> 修改</div>
	<%end if%>
	</td>
</tr>
<%
  rs.movenext
next
rs.close
set rs=nothing
oConn.close
set oConn=nothing
%>
</table>
</form>
</body>
</html>

<%
''''''''''''''''''''''返回当前用户是否有操作权限'''''''''''''''''''''
Function Return_Sort_Manage(managemod,AField,ArchivesID,SField,STable)
''''''''''''''''''''''列表类型,id号,查找字段,查找表名
'返回用户是否有管理/查看权限
dim i
if ArchivesID<>"" and IsNumeric(ArchivesID) then
	select case managemod		'管理/查看列表类型  0:所有用户 1:部门2:职务
		case "0"
			Return_Sort_Manage=true
		case "1"
			TmpSQL="select "&SField&" from " & STable & " where "&AField&"='"&ArchivesID&"'"	'取得管理/查看权限
			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 '判断管理/查看权限中是否包含有当前用户部门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&"'"	'取得管理/查看权限
			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")	'取得当前用户职务
				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	'判断管理/查看权限中是否包含有当前用户职务
							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
'-----------------------------------------------------------
%> 

⌨️ 快捷键说明

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