<%@ page contentType="text/html; charset=GBK"%>
<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.entity.sys.BPIP_ROLE"%>
<%@ page import = "zr.zrpower.entity.sys.BPIP_USER"%>
<%@ page import = "zr.zrpower.entity.sys.BPIP_MENU"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.ejb.sys.UserService"%>
<%@ page import ="zr.zrpower.common.util.StringWork"%>
<%@ page import = "zr.zrpower.ejb.sys.SecurityService"%>

<%@ page import = "java.lang.Object"%>


<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
BPIP_ROLE[] role = null;
BPIP_USER[] userList = null;
BPIP_MENU[] menu = null;
SecurityService SeService =new SecurityService();
UserService UserSer = new UserService();
String usertype = "1";
String strRole_ID = request.getParameter("SelectedItems");
String strunit = "";
strunit = user.getUnitID();
 StringWork sw = new StringWork();
strunit = sw.CutLastZero(strunit,2);
%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<link REL="stylesheet" type="text/css" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/DealList.js"></SCRIPT>

<SCRIPT language="javascript">
function Check(theForm){
  if (!(ListAll())){
    return false;
  }
  theForm.Act.value='edituser';
  return true;
}

</SCRIPT>
</HEAD>
<BODY class="BodyMain">
<%
//得到角色的记录集
role = SeService.GetRoleList2(strRole_ID);
if (role!=null)
{
  %>
  <FORM name="RegForm" method="post" action="../../actionrole.do">
    <input type="hidden" name="ROLEID" value="<%=role[0].getROLEID()%>">
    <input type="hidden" name="UNITID" value="<%=strunit%>">
    <input type="hidden" name="Act" value="">
    <input type="hidden" name="formfields" value="">
    <DIV id="divMessage" style='padding-left:0;padding-top:0;width:100%;height:100%;overflow:auto'>

      <br>&nbsp;
      <fieldset style="width: 98%">
      <legend>分配用户角色信息</legend>
      <table border='0' width="100%"  cellspacing="0" cellpadding="0" align=center>

        <tr>
          <td colspan="2">
      <table border='0' width="90%"  cellspacing="0" cellpadding="0" align=center>
              <tr>
                <td colspan=3 height=23></td>
              </tr>
              <tr>
                <td width="45%" align="center" height=23><font style="font-family: 宋体; font-size: 11pt">所有待选用户信息</font></td>
                <td width="10%" align="center"><font style="font-family: 宋体; font-size: 11pt">操作</font></td>
                <td width="45%" align="center"><font style="font-family: 宋体; font-size: 11pt">角色已选用户信息</font></td>
              </tr>
              <tr>
                <td>
                 <%=SeService.User_AllList("srcList","")%>
                  <br><input type="checkbox" name="SelAllX" onclick="JavaScript:CheckBoxSel(this.checked,'srcList');">全选&nbsp;&nbsp;<Font class="WriteSign">注：使用Ctrl键可选择多个</Font><br>
                </td>
                <td align=center>
                  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
                     <a class="btn1 btn-medium btn-green btn-radius" href="#" onclick="javascript:upFromDestList();">上移</a>
					 <a class="btn1 btn-medium btn-orange  btn-radius" href="#" onClick="javascript:addSrcToDestList();">增加</a>
					 <a class="btn1 btn-medium btn-red btn-radius" href="#" onclick="javascript:deleteFromDestList();">删除</a>
					 <a class="btn1 btn-medium btn-gray btn-radius" href="#" onclick="javascript:downFromDestList();">下移</a>

                  <%}else{ %>
                     <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_U.gif" style="cursor:pointer" title="上移" onclick="javascript:upFromDestList();"><br><br>
                    <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_R.gif" style="cursor:pointer" title="增加" onClick="javascript:addSrcToDestList()"><br><br>
                      <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_L.gif"  style="cursor:pointer" title="删除" onclick="javascript:deleteFromDestList();"><br><br>
                        <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_D.gif"  style="cursor:pointer" title="下移" onclick="javascript:downFromDestList();">

                  <%} %>
                </td>
                <td>
                  <%=SeService.Role_User_List(strRole_ID,"destList","")%>
                  <br><input type="checkbox" name="SelAllX" onclick="JavaScript:CheckBoxSel(this.checked,'destList');">全选&nbsp;&nbsp;<Font class="WriteSign">注：使用Ctrl键可选择多个</Font><br>
                </td>
              </tr>
            </table>

          </td>
        </tr>
      </table>

      <br>
      </fieldset>
      <center><br>
              <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("保 存","JavaScript:if(Check(document.RegForm)){document.RegForm.submit();}","buttonSave.gif",user.getUserImage())%>
                 <%=userUI.ClickButton("返 回","JavaScript:history.back();","buttonReturn.gif",user.getUserImage())%>
              </tr></table>
      </center>


</DIV>
</FORM>
<%
  }
%>
</BODY>

</HTML>
<%
//清空相关对象
user = null;
userUI = null;
role = null;
userList = null;
menu = null;
SeService = null;
UserSer = null;
%>
