<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.organize.*" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
    //获取提交的参数
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
%>
<%
    String sOPERATOR = request.getParameter("OPERATOR");
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));
    //读取数据
    SzUserPostInfo szUserPostInfo = null;

    if (!sKEY.equals("0")) {
        SzUserPost szUserPost = new SzUserPost();
        szUserPostInfo = (SzUserPostInfo)szUserPost.getInfoByKey(Integer.parseInt(sKEY));
    } else {
        szUserPostInfo = new SzUserPostInfo();
    }

    String sCond = "";
    Iterator iter = null;
%>

<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <%@ include file="/share/title.jsp" %>
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="RZID" value="<%=szUserPostInfo.getRZID()%>">
<table width="100%">
  <tr>
    <td>
      <input type="button" name="btnSave" class="btnClass" value="保存" OnClick="javascript:FormSave(formUpdate, 'control.jsp');">
      <input type="button" name="btnBack" class="btnClass" value="返回" OnClick="javascript:FormSubmit(formHidden, 'index.jsp');">
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr >
    <td width="350" rowspan="2" align="left" valign="top"><b>请选择员工</b><br>
<!----这里列出可以选择的用户---->
<%
    String sDLID_selected = "0," + szUserPostInfo.getRZDL();
%>
<%@ include file="/share/organize/login_mult_include.jsp"%>
    </td>

    <td width="350" align="left" valign="top"><b>请选择部门</b><br>
<!----这里列出可以选择的部门---->
<%
    String sBMID_selected = "0," + szUserPostInfo.getRZBM() + ",0";
%>
<%@ include file="/share/organize/depart_mult_include.jsp"%>
  </td>
  </tr>
  <tr>
    <td>
    <b>请选择职务名称</b><br>    
<!----这里列出可以选择的部门---->
<%
    String sZWID_selected = "0," + szUserPostInfo.getRZZW() + ",0";
%>
<%@ include file="/share/organize/post_mult_include.jsp"%>
    </td>
  </tr>
</table>
</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
</form>
<script language="javascript" src="../../share/js/selectTool.js"></script>
<script language="javascript">
  //第一个表示对象，form，第二个表示字符串
  function FormSubmit(oFormName, vUrl) {
    oFormName.action = vUrl;
    oFormName.submit();
  }
</script>
<script language="javascript">
  function FormSave(formName, url) {
    //检查是否可以保存
    if (formName.LoginSelected.length == 0) {
      alert("请选择用户");
      return false;
    }
    if (formName.DepartSelected.length == 0) {
      alert("请选择部门");
      return false;
    }
    //选择全部
    SelectAllOption(formName.LoginSelected);
    SelectAllOption(formName.DepartSelected);
    SelectAllOption(formName.PostSelected);

    //提交
    formName.action = url;
    formName.submit();
  }
</script>

