<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
<style type="text/css">
.clickable_t  
{   
    background-color:#ffffff;
    cursor:hand;
    height:25px;
}
td
{
	font-family: 宋体;
	font-size: 12px;
	color: #000000;
}
body
{
	margin: 0pt;
}
</style>
    <title>
     <s:i18n name="param1">
    <s:property value="getText('title')"/>
    </s:i18n>
    </title>
 

  </head>
  <body>
  <table width="300" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr  bgcolor="#c0c0c0" class="clickable_t">
    <td>&nbsp;&nbsp;[<s:property value="g_name"/>]岗位设定--选取相应操作人员</td>
  </tr>
  <s:set name="ls_gu_yy" value=""></s:set>
  <s:iterator value="department" var="dpt">
  <tr bgcolor="#ffffff">
    <td>
	<table width="300" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td><s:property value="#dpt.DPT_NAME"/></td>
  </tr>
    <s:iterator value="loginuser" var="user">
    <s:if test="#user.EMDEPART==#dpt.DPT_NO">
  <tr>
    <td>
    <table width="300" border="0" cellspacing="1" cellpadding="0">
      <tr onMouseOver="this.style.backgroundColor='#D0E6EE';" onMouseOut="this.style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
        <td width="30">
         <s:if test='OldGUStr.contains(#user.CODE+"*"+#user.EMNAME)'>
          <s:set name="ls_check" value="checked='checked'"></s:set>
          <s:if test='#ls_gu_yy==null || #ls_gu_yy==""'>
            <s:set name="ls_gu_yy" value="#user.CODE+','"></s:set>
          </s:if>
          <s:else>
            <s:set name="ls_gu_yy" value="#ls_gu_yy+#user.CODE+','"></s:set>
          </s:else>
         </s:if>
         <s:else>
          <s:set name="ls_check" value=""></s:set>
         </s:else>
         <input type="checkbox" id="u<s:property value="#user.CODE"/>" value="<s:property value="#user.CODE"/>" <s:property value="#ls_check"/> onclick="getGu('u<s:property value="#user.CODE"/>');"/>
        </td>
        <td><s:property value="#user.EMNAME"/> [ <font color="blue"><s:property value="#user.EMID"/></font> ]</td>
      </tr>
    </table>
    </td>
  </tr>
  </s:if>
  </s:iterator>
</table>
	</td>
  </tr>
  </s:iterator>
  <tr  bgcolor="#ffffff">
    <td align="center">
     <input type="button" value="确定" onclick="ls_submit();"/>
     <input type="button" value="取消" onclick="parent.$('#SendProduct').window('close');;"/>
    </td>
  </tr>
</table>
<form name="ls_togu" method="post" action="groupChoiceLinguserSave">
  <input type="hidden" name="togu"/>
  <input type="hidden" name="gid" value="<s:property value="#parameters.myzd_id[0]"/>"/> 
  <input type="hidden" name="myzd_id" value="<s:property value="#parameters.myzd_id[0]"/>"/>
</form>
  </body>
   <script type="text/javascript">
     var ls_gu="<s:property value='#ls_gu_yy'/>";
     setGu();
     function getGu(ls_guid){
      var guid=document.all.item(ls_guid);
      if(guid.checked==true){
       ls_gu=ls_gu+guid.value+",";
      }else{
       ls_gu=ls_gu.substring(0,ls_gu.indexOf(guid.value))+ls_gu.substring(ls_gu.indexOf(guid.value)+guid.value.length+1);
      }
     }
     function setGu(){
      var ls_temp=ls_gu;
      if(ls_temp!=null && ls_temp.length>0){
       ls_temp=ls_temp.substring(0,ls_temp.length -1);
      }else{
       ls_temp="";
      }
      document.all.item("togu").value=ls_temp;
     }
     function ls_submit(){
      setGu();
      document.all.item("ls_togu").submit();
     }
   </script>
</html>
