📄 selectuser.asp
字号:
<%
'功能:选择单个员工
'修改:展亮
'2003-12-3 20:20
%>
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/Conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<%
Response.Expires=0
Response.Buffer=true
%>
<%
dim ssql,rs
set rs=server.CreateObject("adodb.recordset")
dim stag
stag=Request.Form("tag")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css">
<title>选择人员</title>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function window_onload() {
window.returnValue = '';
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript FOR=window EVENT=onload>
<!--
window_onload()
//-->
</SCRIPT>
<SCRIPT LANGUAGE="javascript">
<!--
function searchuser(userlist,key){
if (!key) return false
eval('re=/'+key+'/')
for (i=userlist.options.selectedIndex+1; i<userlist.options.length; i++){
if(re.test(userlist.options[i].text)){
userlist.options[i].selected=true
return false
}
}
for (i=0; i<userlist.options.selectedIndex+1; i++){
if(re.test(userlist.options[i].text)){
userlist.options[i].selected=true
return false
}
}
}
//-->
</SCRIPT>
</head>
<%
dim ary()
redim ary(4,0)
%>
<body class="tdbottom">
<table align="center" width="400">
<tr><td>
<table width="100%" border=0 align=center cellpadding=2 cellspacing=1 class="tab">
<form method=post name=frmxx id=frmxx onsubmit="return false">
<tr>
<td class="tdtop2" colspan="2">
<img border="0" src="../images/icon_title.gif" align="left">
选择人员
<span onclick="vbscript:usebm"><input type="radio" value="V1" name="R1" Checked hidefocus=true>按部门选择</span> <span onclick="vbscript:usezw"><input type="radio" value="V1" name="R1" hidefocus=true>按职位选择</span>
</td>
</tr>
<tr class="td2">
<td width=70 align=right>部门/职位:</td>
<td width=330>
<select id=bm name=bm style="display:inline" onchange="vbscript:chgbm" style="width:100%">
<option value="X" selected>所有部门</option>
<%
ssql="select * from tbioaDepartment where ParentID='0' order by id"
rs.Open ssql,oConn,1,1
do while not rs.EOF
Call pOptions("tbioaDepartment","Name",0,Department,"")
rs.MoveNext
loop
rs.Close
%>
</select>
<select id=zw name=zw style="display:none" onchange="vbscript:chgzw" style="width:100%">
<option value="X" selected>所有职位</option>
<%
ssql="SELECT tbioaRole.*, tbioaDepartment.Name AS departmentname FROM tbioaRole INNER JOIN tbioaDepartment ON tbioaRole.department = tbioaDepartment.ID"
rs.Open ssql,oConn,1,1
do while not rs.EOF
%>
<option value="<%=rs("id")%>"><%=server.HTMLEncode(rs("departmentname") & "/" & rs("rolename") & "")%></option>
<%
rs.MoveNext
loop
rs.Close
%>
</select>
</td>
</tr>
<tr class="td2">
<td width=70 align=right>可选人员:</td>
<td>
<select id=ry name=ry style="display:inline" style="width:60%">
<%
ssql="select a.ygbh,a.ygxm,a.ssbm,a.zw,b.bmmc from rs_ygb a ,rs_bmb b where a.ssbm=b.bmbh and (ryzt='0' or ryzt='2') order by a.ygxm asc"
ssql="select * from tbioaUser where department<>0 order by id asc"
rs.Open ssql,oConn,1,1
dim i
redim ary(4,rs.RecordCount)
for i=1 to rs.RecordCount
ary(0,i)=rs("id")
ary(1,i)=rs("name")
ary(2,i)=rs("department")
ary(3,i)=rs("roleid")
ary(4,i)=rs("department")
%>
<option value=<%=rs("id")%>><%=server.HTMLEncode(rs("name") & "")%></option>
<%
rs.MoveNext
next
rs.Close
%>
</select>
<input type="text" name="searchname" style="width:20%">
<a href="#" onclick="return searchuser(frmxx.ry,frmxx.searchname.value)">
<img src="../images/search.gif" border="0" align="absmiddle">查找
</a>
</tr>
</form>
</table>
</td>
</tr>
</table>
<table width=100%>
<tr>
<td align="middle" colspan="2">
<input type=button class="button0" onmouseout=className="button0" onmouseover=className="button1" value=确定 name="bQD" id="bQD" onclick="vbscript:doSave">
<input type=button class="button0" onmouseout=className="button0" onmouseover=className="button1" value=放弃 name="bFQ" id="bFQ" onclick='vbscript:window.close'>
</td>
</tr>
</table>
<%
set rrs = nothing
oConn.Close
set oConn = nothing
%>
</BODY>
</html>
<script language=vbscript>
<!--
dim ary()
redim ary(4,0)
<%
Response.Write "redim ary(4," & ubound(ary,2) & ")" & vbcrlf
for i= 0 to ubound(ary,2)
Response.Write "ary(0," & i & ")=""" & ary(0,i) & """" & vbcrlf
Response.Write "ary(1," & i & ")=""" & ary(1,i) & """" & vbcrlf
Response.Write "ary(2," & i & ")=""" & ary(2,i) & """" & vbcrlf
Response.Write "ary(3," & i & ")=""" & ary(3,i) & """" & vbcrlf
Response.Write "ary(4," & i & ")=""" & ary(4,i) & """" & vbcrlf
next
%>
<%if stag="zw" then%>
usezw
<%else%>
usebm
<%end if%>
sub usebm
frmxx.R1(0).checked=true
frmxx.bm.value="X"
chgbm
frmxx.bm.style.display="inline"
frmxx.zw.style.display="none"
end sub
sub usezw
frmxx.R1(1).checked=true
frmxx.zw.value="X"
chgzw
frmxx.zw.style.display="inline"
frmxx.bm.style.display="none"
end sub
sub chgbm
dim i,e
for i= 0 to frmxx.ry.options.length-1
frmxx.ry.options.remove 0
next
for i=1 to ubound(ary,2)
if frmxx.bm.value=ary(2,i) or frmxx.bm.value="X" then
Set e = Document.createElement("OPTION")
e.value=ary(0,i)
e.text=ary(1,i)
frmxx.ry.options.add e
end if
next
end sub
sub chgzw
dim i,e
for i= 0 to frmxx.ry.options.length-1
frmxx.ry.options.remove 0
next
for i=1 to ubound(ary,2)
if instr("," & ary(3,i) & ",", "," & frmxx.zw.value & ",")>0 or frmxx.zw.value="X" then
Set e = Document.createElement("OPTION")
e.value=ary(0,i)
e.text=ary(1,i)
frmxx.ry.options.add e
end if
next
end sub
sub doSave
if frmxx.ry.value="" then
msgbox "请选择人员",vbInformation,"提示"
exit sub
end if
dim s1
s1=frmxx.ry.value & "_" & frmxx.ry.item(frmxx.ry.selectedIndex).innertext
window.returnValue = s1
window.close
end sub
//-->
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -