<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.organize.SzPost" %>
<%@ page import="net.sz600.organize.SzPostInfo" %>
<%@ include file="/sessionInfo.jsp"%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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"));
    //读取数据
    SzPostInfo szPostInfo = null;
    if (!sKEY.equals("0")) {
        SzPost szPost = new SzPost();
        szPostInfo = (SzPostInfo)szPost.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (szPostInfo == null) {
        szPostInfo = new SzPostInfo();
        szPostInfo.setZWDJ(0);
    }
%>

<!-----上面的工具栏------>
<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="ZWID" value="<%=szPostInfo.getZWID()%>">
<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="30%" align="right">职务名称</td>
    <td><input type="text" name="ZWMC" class="txtClass1" value="<%=szPostInfo.getZWMC()%>">
    </td>
  </tr>
  <tr>
    <td width="30%" align="right">职务等级</td>
    <td>
    <%
      String name_str[] = SzProperties.POST_NAME_STR;
      String id_str[] = SzProperties.POST_ID_STR;
      out.println(SzPageHelp.idSelectArray(name_str, id_str, "ZWDJ", "" + szPostInfo.getZWDJ(), "txtClass1"));
    %>
    </td>
  </tr>
  <tr>
    <td width="30%" align="right" valign="top">职务描述</td>
    <td><textarea name="ZWMS" class="areaClass2"><%=szPostInfo.getZWMS()%></textarea></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">
  //第一个表示对象，form，第二个表示字符串
  function FormSubmit(oFormName, vUrl) {
    oFormName.action = vUrl;
    oFormName.submit();
  }
</script>
<script language="javascript">
  function FormSave(formName, url) {
    //检查是否可以保存
    if (formName.ZWMC.value == "") {
      formName.ZWMC.focus();
      alert("职务名称不能为空");
      return false;
    }
    //提交
    formName.action = url;
    formName.submit();
  }
</script>
