<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.organize.SzLogin" %>
<%@ page import="net.sz600.organize.SzLoginInfo" %>
<%
    //读取全体用户
    //读取数据
    SzLogin login = new SzLogin();
    SzLoginInfo loginInfo = null;
    String sCond = "1=1";
    Iterator iter = login.getArrayList(sCond).iterator();
%>

<table width="350" align="center">
  <form name="formSelect" method="post">
  <tr>
    <td colspan="3">请选择系统用户
    </td>
  </tr>
  <tr>
    <td width="150" align="right">
      <select name="LoginSelecting" size="15" style="width:150;" OnDblClick="MoveSelectedOption(formSelect.LoginSelecting, formSelect.LoginSelected);">
<%
    while (iter!=null && iter.hasNext()) {
        loginInfo = (SzLoginInfo)iter.next();
%>
        <option value="<%=loginInfo.getDLID()%>"><%=loginInfo.getDLXM()%>[<%=loginInfo.getDLZH()%>]</option>
<%
    }
%>
      </select>
    </td>
    <td width="50">
      <table>
        <tr><td><input type="button" name="btnToRight" value=">>" OnClick="MoveSelectedOption(formSelect.LoginSelecting, formSelect.LoginSelected);"></td></tr>
        <tr><td><input type="button" name="btnToLeft" value="<<" OnClick="MoveSelectedOption(formSelect.LoginSelected, formSelect.LoginSelecting);"></td></tr>
      </table>
    </td>
    <td width="150" align="left">
      <select name="LoginSelected" size="15" style="width:150;" OnDblClick="MoveSelectedOption(formSelect.LoginSelected, formSelect.LoginSelecting);">
      </select>
    </td>
  </tr>
  <tr>
    <td colspan="3" align="center">
      <input type="button" name="btnSave" value="保存">
      <input type="button" name="btnClose" value="关闭" OnCLick="javascript:window.close();">
    </td>
  </tr>
  </form>
</table>
<script language="javascript">
  //第一个表示对象，form，第二个表示字符串
  function FormSubmit(oFormName, vUrl) {
    oFormName.action = vUrl;
    oFormName.submit();
  }

  function GoUrl(vUrl) {
    document.location.href = vUrl;
  }

  //javascript参数的调用：
  //checkAll(formList,chkCheckAll,'chkId')
  //第一个表示对象，第二个表示对象，第三个表示字符串
  function CheckAll(oFormList, oChkCheckAll, vChkId) {
    var e;
    for (var i=0; i<oFormList.elements.length; i++) {
      e = oFormList.elements[i];
      if (e.name == vChkId) {
        e.checked = oChkCheckAll.checked;
      }
    }
  }

  //MoveSelectedOption(oFrom, oTo)
  //移动选中的option
  function MoveSelectedOption(oFrom, oTo) {
    var iLen = oFrom.length
    var i = 0;
    //将选中的oFrom的option加到to中
    for (i=0; i<iLen; i++) {
      if (oFrom.options[i].selected) {
        oTo.options[oTo.length] = new Option(oFrom.options[i].text,oFrom.options[i].value);
      }
    }
    //将选中的oFrom的option设置为null
    for (i=iLen-1; i>-1; i--) {
      if (oFrom.options[i].selected) {
        oFrom.options[i]=null;
      }
    }
    //选中一个后将按纽设置为disable
  }

</script>