<!--#include file="../inc/Secure.htm"-->
<!--#include file="../inc/conn.htm"-->
<!--#include file="../inc/const.htm"-->
<!--#include file="../inc/dbtools.htm"-->
<%
selectusers = trim(request("SelectedUsers"))
if left(selectusers,"1")="," then selectusers=right(selectusers,len(selectusers)-1)
arrSelectUsers=split(selectusers,",")
dim strSelectUsers
selectusers2=""
if not isempty(arrSelectUsers) then
	for i=ubound(arrSelectUsers) to 0 step -1
	str=GetTableValue("tblUser","Name",arrSelectUsers(i))
	strSelectUsers=strSelectUsers &","& str
	selectusers2=selectusers2 & "," & arrSelectUsers(i)
	next
	if left(strSelectUsers,"1")="," then strSelectUsers=right(strSelectUsers,len(strSelectUsers)-1)
	if left(trim(SelectUsers2),"1")="," then SelectUsers=right(trim(SelectUsers2),len(trim(SelectUsers2))-1)
end if
%>
<html>
<head>
<title> 选择用户 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</head>
<script src="../inc/selectuser2.js"></script>
<body bgcolor=#dddddd <%if selectusers<>"" then  response.write "onload=""closewindow('"&selectusers&"','"&strSelectUsers&"');"""%>>
</body>

<%
Department=trim(request("Department"))
if Department="" then Department=0

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,Name,Department,Position from tblUser where id>0 "
if Department<>"0" then
sql=sql&" and Department = "& Department 
end if
sql=sql& " order by Name"
rs.open sql,oConn,1,1
totalmessage=rs.recordcount
if totalmessage<>0 then
	msgArr=rs.getrows()
end if

rs.close
%>

<table width="100%" border=0 bgcolor=#dddddd>
<tr>
	<td colspan=3>
	<Form name="userform" Method="Post" action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
		请选择部门科室：<%options "Department","tblDepartment","Name",Department%>	
		<INPUT TYPE="submit" Name="cmdSearch" value="检索">
	</td>
	<td></td>
</tr>

<tr>
	<td align=center bgcolor=#9900CC><font color=#ffffff>职员一揽表</font></td>
	<td></td>
	<td align=center bgcolor=#9900CC><font color=#ffffff>被选择职员列表</font></td>
	<td></td>
</tr>

<tr>
	<td>员工姓名&nbsp;&nbsp; 所在部门&nbsp;&nbsp; 职务</td>
	<td rowspan=2 width=30>
	<input type="button" value="添加 →" onClick="addConfirmer(); return false;"><BR>
	<input type="button" value="← 删除" onClick="removeConfirmer(); return false;">
	</td>
	<td>员工姓名&nbsp;&nbsp; 所在部门&nbsp;&nbsp; 职务</td>
	<td></td>
</tr>

<tr>
	<td>
	<select name="selectableIDList" multiple size="15" style="width:100%;" ondblClick="addConfirmer(); return false;">
	<%if not isempty(msgArr) then
		for i = 0 to UBound(msgArr,2)%>
		<option value="<%=trim(msgArr(0,i))%>">
		<%=server.htmlencode(trim(msgArr(1,i)))%>&nbsp;&nbsp;&nbsp;&nbsp;
		<%=GetTableValue("tblDepartment","Name",trim(msgArr(2,i)))%>&nbsp;&nbsp;&nbsp;&nbsp;
		<%=server.htmlencode(trim(msgArr(3,i)))%>
		</option>
	<%next
	end if
	%>
	</select>
	</td>
	<td>
	<select name="selectedIDList" multiple size="15" style="width:100%;" ondblClick="removeConfirmer(); return false;">
	</select>
	</td>
	<td>
		<table>
        <tr>
          <td>
            <input border=0 name=flowroute_upuser src="../images/upbutton.gif" type=image width="18" height="18"  onClick="moveUpDn(-1); return false;" >
          </td>
        </tr>
        <tr>
          <td>
            <input border=0 cache name=flowroute_downuser src="../images/downbutton.gif" type=image width="18" height="18" onClick="moveUpDn(1); return false;" >
          </td>
        </tr>
		</table>
	</td>
</tr>
</table>
<INPUT TYPE="hidden" name="operatorID" value="<%=session("LoginID")%>">
<INPUT TYPE="hidden" name="SelectedUsers" value="">
<div align=right>
<INPUT TYPE="submit" value="确 定" name="cmdUp" onclick="GetUsers();">
<input type="button" onclick="javascript:window.close();" value="放 弃">
</div>
</form>


</html>
<!--#include file="../inc/conn_close.htm"-->

<script language="JavaScript">
function OpenWindow(url,windowname)
{
window.open(url,windowname,'left=100,top=50,height=450,width=650,toolbar=no,menubar=no,scrollbars=yes')
}
</script>