<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
option explicit
response.buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
const Dir=1
%>
<!--#INCLUDE FILE="HX_CONNDATABASE.ASP"-->
<!--#INCLUDE FILE="HX_MD5.ASP"-->
<!--#INCLUDE FILE="HX_SETCOOKIE.ASP"-->
<head>
<title>选择员工</title>
<link rel=stylesheet type=text/css href="../HXinclude/HX_Css.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body topmargin="10" leftmargin="0" bottommargin="10" bgcolor="D4D0C8">
<table width="99%" cellspacing=1 cellpadding=2 align="center">
 <form action="" method="post" name="form1">
  <%
  checkuser=request("checkuser")
  aaa=1
  set SERS=WS_S.HX_SetRSD("","HX_Department"," order by WS_OrderBy asc")
  if SERS.recordcount>0 then
  do until sers.eof
  %>
  <tr><td width="100%"><font size="2"> 
  <%=sers("WS_DepartmentName")%>
  </td></tr>
  <%set APRS=WS_S.HX_SetRSD("","HX_Appointment"," where WS_Did="&sers("WS_Did")&" order by WS_OrderBy asc")
     if APRS.recordcount>0 then
	   do until APRS.eof
  %>

   <tr>
    <td>&nbsp;&nbsp;<font color="#48230C"><%=APRS("WS_AppointmentName")%></font><%
	set URS=WS_S.HX_SetRSD("","HX_CompanyUser"," where WS_department="&sers("WS_Did")&" and WS_Appointment="&APRS("WS_Aid")&" and WS_leave=False and WS_Uid<>"&loginuid&" order by WS_Uid asc")
	if URS.recordcount>0 then
	  response.write "　　"
	  do until URS.eof
	   response.write "<input name='Uid"&aaa&"' type='hidden' value='"&urs("WS_Uid")&"'><input type='checkbox' name='name"&aaa&"' class='radio' value="&urs("WS_Name")&" id='WSOA"&urs("WS_Uid")&"'><label for='WSOA"&urs("WS_Uid")&"'><font color=blue>"&URS("WS_Name")&"</font></label>&nbsp;&nbsp;"
	   aaa=aaa+1
	  URS.movenext
	  loop
	end if
	%>	
	</td>
  </tr>
  <%    APRS.movenext
        loop
     end if
 %>
  <tr>
     <td height=5><hr width="100%"></td>
   </tr>
 <%
  sers.movenext
  loop
  end if
 %>
   <tr>
     <td height=25 align="right"><input type="checkbox" name="checkbox" id="checkall" value="Check All" onClick="mm()" align="absmiddle" class="radio"><label for="checkall">全选</label>
	 <input name="button" type="button" value=" 确 定 " onClick="select_man();">　 
	 </td>
   </tr>
 </form>
</table>
 <script language="javascript">
function select_man()
{
t=""
u=""
a=""
<% for  n=1 to aaa-1%>
if(form1.name<%=n%>!=null)
{
if(form1.name<%=n%>.checked==true && form1.name<%=n%>.value!=null)
{
	if(t!="") {t+="|";u+="|";}
	{t+=form1.name<%=n%>.value;u+=form1.Uid<%=n%>.value;}
}
}
<%next%>
t+="|";
u+="|";
opener.form1.WS_<%=checkuser%>Name.value=t;
opener.form1.WS_<%=checkuser%>Uid.value=u;
window.close()
}
</script>
<script language=javascript>
function mm()
{
   var a = document.getElementsByTagName("input");
   if(a[0].checked==true){
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = false;
   }
   else
   {
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = true;
   }
}
</script>