setting.htm

来自「全方面的OA管理程序代码」· HTM 代码 · 共 187 行

HTM
187
字号
<!--#include file="../inc/Secure.htm"-->
<!--#include file="../inc/conn.htm"-->
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../css/main.css">
</HEAD>
<%
LoginID=session("LoginID")
if LoginID="" then response.end

if request("DelSet")<>"" then
	oConn.execute "update tblUser set OtherLookIDs='' where ID="& LoginID
	set rs=server.createobject("adodb.recordset")
	sql="select id,LookOtherIDs,OtherLookIDs from tblUser"
	rs.open sql,oConn,1,1
	while not rs.eof
	id_t=trim(rs("ID"))
	str_t=trim(rs("LookOtherIDs"))
	str_Now=DelAstring(str_t,LoginID)
	oConn.execute "update tblUser set LookOtherIDs ='"& str_Now &"' where ID="& id_t
	rs.movenext
	wend
	rs.close
end if

if request("cmdUp")<>"" then
	NameList=trim(request("NameList"))
	IDlist=trim(request("IDlist"))
	arrIDs=split(IDlist,",")
	
	oConn.execute "update tblUser set OtherLookIDs='"& IDlist &"' where ID="& LoginID

	set rs=server.createobject("adodb.recordset")
	sql="select id,LookOtherIDs from tblUser where id <>"& LoginID

	rs.open sql,oConn,1,1
	while not rs.eof
	id_t=trim(rs("ID"))
	bYes=false
	for i=0 to ubound(arrIDs)
		if id_t=arrIDs(i) then
		bYes=true
		end if
	next
	if bYes then	
	str_t=trim(rs("LookOtherIDs"))
	str_Now=AddAstring(str_t,LoginID)
	'response.write "update tblUser set LookOtherIDs ='"& str_Now &"' where ID="& id_t
	oConn.execute "update tblUser set LookOtherIDs ='"& str_Now &"' where ID="& id_t
	end if

	rs.movenext
	wend
	rs.close
	oConn.close
response.write "更改成功!<a href='filemanager.htm'>[返回]</a>"
response.end
end if

OtherLookIDs=GetTableValue ("tblUser","OtherLookIDs","ID",LoginID)
if isnull(OtherLookIDs) then OtherLookIDs=""

arrOtherLookIDs=split(OtherLookIDs,",")
strOtherLook=""

for i=0 to ubound(arrOtherLookIDs)
	strOtherLook=strOtherLook& GetTableValue ("tblUser","Name","ID",arrOtherLookIDs(i))&","	
next
if instr(strOtherlook,",")>0 then strOtherlook=left(strOtherlook,len(strOtherlook)-1)
%>
<BODY BGCOLOR="#FFFFFF">

<fieldset title="设置可以查看自己文件的用户">
<legend align=center><font color=red class="pt11"><b>设置权限</b></font></legend> 
<div align=center>
<p>你可以设置有权限查看你私人目录的人员,一般是自己的上级。</p>
<form name="UserForm" method="post" action="">
<table border=0 width="80%">
<tr>
	<td>重新设置人员:<input type="text" name="NameList" value="" size=30 readonly class="doc_txt" ></td>
	<td><INPUT TYPE="button" name="cmdAttach" value="指定对象" onclick="OpenWindow('ReadUsers.htm','UserWindow')" class="font9boldwhite"></td>
</tr>
<tr>
	<td>或清空旧设置:<input type="text" name="OldNameList" value="<%=strOtherLook%>" size=30 readonly class="doc_txt" ></td>
	<td><INPUT TYPE="submit" name="DelSet" value="清空旧设置" class="font9boldwhite" onclick="return CheckDelete();"></td>
</tr>
<tr>
	<td><BR></td><td><BR><INPUT TYPE="submit" name="cmdUp" value="确定保存" class="font9boldwhite" onclick="return CheckData();"></td>
</tr>
</table>
<INPUT TYPE="hidden" name="IDList" value="">
</form><BR>
</div></fieldset>

</BODY>
</HTML>
<script language=javascript>
function CheckDelete()
{
	return confirm("确实清空吗?");
}
function CheckData()
{
	if(jtrim(document.UserForm.NameList.value)=="")
	{
	alert("请选择人员");
	return false;
	}
	return true;

}
function OpenWindow(url,windowname)
{
window.open(url,windowname,'left=100,top=50,height=350,width=650,toolbar=no,menubar=no,scrollbars=yes')
}
</script>
<script language="javascript" src="../inc/jtrim.js"></script>
<script src="../Document/Popup.js"></script>
<!--#include file="../inc/conn_close.htm"-->

<%
Function GetTableValue(TableName,Field,ValueField,Value)
	if TableName<>"" and Value<>"" then
		Set RsTmp = Server.Createobject("Adodb.recordset")
		strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"='"& Value &"'"
		Rstmp.open strSql,oConn,1,1
		If not Rstmp.eof then
			GetTableValue=trim(Rstmp(Field))
		else
			GetTableValue=""
		end if
		Rstmp.close
		'set RsTmp = Nothing
	else
		GetTableValue=""
	end if
End Function

Private Function DelAstring(Byval strTemp,Byval strDelTemp)
strTemp=trim(strTemp)
strDelTemp=trim(strDelTemp)
IF strTemp=strDelTemp or strTemp=","&strDelTemp or strTemp=strDelTemp&"," then
	DelAstring=""
	exit function
end if
if strTemp<>"" and instr(strTemp,strDelTemp)>0 then
	arrString=split(strTemp,",")
	strFinal=""
	for i=0 to ubound(arrString)
		if trim(arrString(i))<>trim(strDelTemp) then
			strFinal=strFinal& trim(arrString(i))&","
		end if
	next
	if strFinal<>"" and instr(strFinal,",")>0 then strFinal=left(strFinal,len(strFinal)-1)
	DelAString = strFinal
else
	DelAstring=strTemp
end if
end Function

Private Function AddAstring(Byval strTemp,Byval strAddTemp)
strTemp=trim(strTemp)
strAddTemp=trim(strAddTemp)
IF strTemp=strAddTemp or strTemp=","&strAddTemp or strTemp=strAddTemp&"," then
	AddAstring=strAddTemp
	exit function
end if

if strTemp<>"" then
	arrString=split(strTemp,",")
	bFind=false
	for i=0 to ubound(arrString)
		if trim(arrString(i))=trim(strAddTemp) then
			bFind=true
		end if
	next
	if not bFind then
		AddAstring = strTemp&","&strAddTemp
	else
		AddAstring = strTemp
	end if
else
	AddAstring=strAddTemp
end if
end Function
%>

⌨️ 快捷键说明

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