<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
action=request("action"):WS_Uid=request("WS_Uid"):ColumnName="":Tablename="HX_CompanyUser"
if WS_Uid<>"" then
select case action
 case "deluser"
   if instr(WS_Uid,",")>0 then     
     for ii=0 to ubound(split(WS_Uid,","))      
	 if cint(split(WS_Uid,",")(ii))<>cint(loginuid) then
	  if request("delmember")="yes" then
	   if WS_S.HX_IsNUM(split(WS_Uid,",")(ii)) then conn.execute("delete * from HX_CompanyUser where WS_Uid="&split(WS_Uid,",")(ii))
	  else
	   if WS_S.HX_IsNUM(split(WS_Uid,",")(ii)) then conn.execute("update HX_CompanyUser set WS_leave=True where WS_Uid="&split(WS_Uid,",")(ii))
      end if
	 end if
	 next
   else
     if WS_Uid<>loginuid then
       if request("delmember")="yes" then
        if isnumeric(WS_Uid) then conn.execute("delete * from HX_CompanyUser where WS_Uid="&WS_Uid)
	   else
        if  isnumeric(WS_Uid) then conn.execute("update HX_CompanyUser set WS_leave=True where WS_Uid="&WS_Uid)
       end if
	 end if 
   end if
   WS_S.HX_Redirect"deluser.asp"
 case "reuser"
   if instr(WS_Uid,",")>0 then     
     for ii=0 to ubound(split(WS_Uid,","))
	   if WS_S.HX_IsNUM(split(WS_Uid,",")(ii)) then conn.execute("update HX_CompanyUser set WS_leave=False where WS_Uid="&split(WS_Uid,",")(ii))
	 next
   else
       if isnumeric(WS_Uid) then conn.execute("update HX_CompanyUser set WS_leave=False where WS_Uid="&WS_Uid)
   end if
   WS_S.HX_Redirect"deluser.asp"
end select
end if
response.Write "<head><title>删除员工</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head><body topmargin='20' leftmargin='0' bottommargin='20'><table width='609'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td width='609' colspan='2' bgcolor=FFFBE8><table width='609'  border='0' cellspacing='0' cellpadding='0'><tr><td width='609' height='25' background='../hximages/titleline.gif'><font class='fontmenu'>删除员工</font></td></tr></table><table width='100%' border='1' cellspacing='0' cellpadding='3' align='center' bordercolorlight='#000000' bordercolordark='#FFFBE8'><tr bgcolor='#FFFBE8'><td height='25'>请选择将要离职的员工</td><td>请选择要恢复数据的员工(<font color='FF0000'>离职员工不能登录OA</font>)</td></tr><tr bgcolor='#FFFBE8'><form action='' method='post' name='form1'><td width='49%' valign='top'><script language='javascript'>function func_select_all1(){ for (i=document.form1.WS_Uid.options.length-1; i>=0; i--) document.form1.WS_Uid.options(i).selected=true;}function func_select_all2(){ for (i=document.form2.WS_Uid.options.length-1; i>=0; i--) document.form2.WS_Uid.options(i).selected=true;}</script>"
set rs=WS_S.HX_SetRSD(ColumnName,Tablename," where WS_leave=False")
response.Write "<div align='center'><select name='WS_Uid' class='box' MULTIPLE style='width:200;height:280'>"
while not rs.eof	
WS_S.HX_OutUserInfo(rs("WS_Uid"))
response.Write "<option value='"&rs("WS_Uid")&"'>["&Outdepartment&" "&OutAppointment&"] "&OutUserName&"</option>"
rs.movenext
wend
WS_S.HX_RSClose rs 
response.Write "</select><br><input type='button' value=' 全 选 ' onclick='func_select_all1();' class='SmallInput'> <input name='delmember' type='checkbox' value='yes' style='background:FFFBE8;' class=radio id='yesdel' onclick=""if(document.form1.delmember.checked==true){if(!confirm('执行此操作将不可恢复，是否要彻底删除所选的员工?')) document.form1.delmember.checked=false;}""><label for='yesdel' style='cursor:hand'>彻底删除</label> <input name='submit' type='submit' value='删除&gt;&gt;&gt;'><input type='hidden' name='action' value='deluser'></div></td></form><form action='' method='post' name='form2'><td width='51%' valign='top'>"
set rs=WS_S.HX_SetRSD(ColumnName,Tablename," where WS_leave=True")
response.Write "<div align='center'><select name='WS_Uid' MULTIPLE style='width:200;height:280'>"
while not rs.eof	
WS_S.HX_OutUserInfo(rs("WS_Uid"))
response.Write "<option value='"&rs("WS_Uid")&"'>["&Outdepartment&" "&OutAppointment&"] "&OutUserName&"</option>"
rs.movenext
wend
WS_S.HX_RSClose rs 
response.Write "</select><br><input name='Submit2' type='submit' value='&lt;&lt;&lt;恢复'> <input name='button' type='button' class='SmallInput' onClick='func_select_all2();' value=' 全 选 '><input type='hidden' name='action' value='reuser'></div></td></form></tr><tr bgcolor='#613c25'><td colspan='2' align='center'>点击条目时，可以组合CTRL或SHIFT键进行多选</td></tr></table></td></tr></table>"
%>