<%@ 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_gm_yy" value=""></s:set>
  <s:iterator value="moduletype" var="mt">
  <tr bgcolor="#ffffff">
    <td>
	<table width="300" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td><s:property value="#mt.MT_NAME"/></td>
  </tr>
    <s:iterator value="module" var="m">
    <s:if test="#mt.MT_ID==#m.MT_ID">
  <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='OldGMStr.contains(#m.M_ID+"*"+#m.M_NAME) && OldGMAllStr.contains(#m.M_ID+"*"+#m.M_NAME)'>
          <s:set name="ls_check" value="checked='checked'"></s:set>
          <s:if test='#ls_gm_yy==null || #ls_gm_yy==""'>
            <s:set name="ls_gm_yy" value="#m.M_ID+','"></s:set>
          </s:if>
          <s:else>
            <s:set name="ls_gm_yy" value="#ls_gm_yy+#m.M_ID+','"></s:set>
          </s:else>
         </s:if>
         <s:elseif test='!OldGMStr.contains(#m.M_ID+"*"+#m.M_NAME) && OldGMAllStr.contains(#m.M_ID+"*"+#m.M_NAME)'>
          <s:set name="ls_check" value="disabled='disabled'"></s:set>
         </s:elseif>
         <s:else>
          <s:set name="ls_check" value=""></s:set>
         </s:else>
         
         <input type="checkbox" id="m<s:property value="#m.M_ID"/>" value="<s:property value="#m.M_ID"/>"  <s:property value="#ls_check"/> onclick="getGm('m<s:property value="#m.M_ID"/>');"/>
        </td>
        <td><s:property value="#m.M_NAME"/>(<s:property value="#m.M_MENU"/>)</td>
      </tr>
    </table>
    </td>
  </tr>
  </s:if>
  </s:iterator>
</table>
	</td>
  </tr>
  </s:iterator>
  <tr  bgcolor="#ffffff">
    <td align="center">
    <s:if test="#session.userInfo['CODE']=='6666'">
     <input type="button" value="确定" onclick="ls_submit();"/>
    </s:if>
     <input type="button" value="取消" onclick="parent.$('#SendProduct').window('close');"/>
    </td>
  </tr>
</table>
<form name="ls_togm" method="post" action="groupChoiceModuleSave">
  <input type="hidden" name="togm"/>
  <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_gm="<s:property value='#ls_gm_yy'/>";
     setGm();
     function getGm(ls_gmid){
      var gmid=document.all.item(ls_gmid);
      if(gmid.checked==true){
       ls_gm=ls_gm+gmid.value+",";
      }else{
       ls_gm=ls_gm.substring(0,ls_gm.indexOf(gmid.value))+ls_gm.substring(ls_gm.indexOf(gmid.value)+gmid.value.length+1);
      }
     }
     function setGm(){
      var ls_temp=ls_gm;
      if(ls_temp!=null && ls_temp.length>0){
       ls_temp=ls_temp.substring(0,ls_temp.length -1);
      }else{
       ls_temp="";
      }
      document.all.item("togm").value=ls_temp;
     }
     function ls_submit(){
      setGm();
      document.all.item("ls_togm").submit();
     }
   </script>
</html>
