- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
- <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
- <%
- Request m_request = new Request(request);
- int iUserID = m_request.GetInt("ID");
- int iDepartmentID = m_request.GetInt("DepartmentID");
- if(iUserID<1)
- {
- %>
- <script language="JavaScript" type="text/JavaScript">
- alert("请选择正确的用户,修改失败!");
- history.back();
- </script>
- <%
- }
- else
- {
- Vector vt = UserManager.getUserInfoByID(iUserID);
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <title>用户管理-- GForce OA 2.0</title>
- <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
- <script language="JavaScript" src="/js/changestyle.js"></script>
- <SCRIPT language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
- <script language="JavaScript" type="text/javascript">
- function checkEditUser()
- {
- if(document.edituser.DepartmentID.value=="")
- {
- alert("请选择所属部门!");
- document.edituser.DepartmentID.focus();
- return false;
- }
- if(document.edituser.PersonnelID.value=="0")
- {
- alert("请选择员工姓名!");
- document.edituser.PersonnelID.focus();
- return false;
- }
- if(document.edituser.UserName.value=="")
- {
- alert("请输入用户名称!");
- document.edituser.UserName.focus();
- return false;
- }
- if(document.edituser.Password.value=="")
- {
- alert("输入用户密码!");
- document.edituser.Password.focus();
- return false;
- }
- if(document.edituser.Password1.value=="")
- {
- alert("输入确认密码!");
- document.edituser.Password1.focus();
- return false;
- }
- if(document.edituser.Password.value!=document.edituser.Password1.value)
- {
- alert("用户密码和确认密码不一致,请重新填写密码!");
- document.edituser.Password.value="";
- document.edituser.Password1.value="";
- document.edituser.Password.focus();
- return false;
- }
- if(document.edituser.RoleID.value=="0")
- {
- alert("请选择用户角色!");
- document.edituser.RoleID.focus();
- return false;
- }
- }
- var arrayPersonnel = new Array();
- <%
- Vector vPersonnel = PersonnelManager.getFreePersonnels(iUserID);
- for(int i=0;i<vPersonnel.size();i++)
- {
- out.println("arrayPersonnel["+ i +"]=new Array("" + ((Vector)vPersonnel.get(i)).get(0).toString() + "","" + ((Vector)vPersonnel.get(i)).get(1).toString() + "","" + ((Vector)vPersonnel.get(i)).get(13).toString() + "");");
- }
- %>
- function addPersonnel()
- {
- with(document.edituser)
- {
- PersonnelID.length=1;
- PersonnelID.selectedIndex=0;
- for(var i=0;i < arrayPersonnel.length;i++)
- {
- if(arrayPersonnel[i][2]==DepartmentID.value)
- {
- var oOption = document.createElement("OPTION");
- PersonnelID.options.add(oOption);
- oOption.innerText = arrayPersonnel[i][1];
- oOption.value = arrayPersonnel[i][0];
- if(arrayPersonnel[i][0]=="<%=((Vector)vt.get(0)).get(3).toString()%>")
- oOption.selected = true;
- }
- }
- }
- }
- </script>
- </head>
- <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0" onload="javascript:addPersonnel();">
- <table width="100%" height="100%" border="0" align="center" cellspacing="0">
- <tr>
- <td align="center" valign="top"><p> </p>
- <form name="edituser" action="EditUserAction.jsp" method="post" onSubmit="javascript:return checkEditUser();">
- <table width="95%" border="1" align="center" cellpadding="0" cellspacing="0">
- <tr height="100">
- <td width="22%" align="right" valign="middle" nowrap><font color="#0A0A0A">所属部门:</font></td>
- <td width="78%" align="left" valign="middle" nowrap>
- <input type="hidden" name="DepartmentID" id="DepartmentID" value="<%=iDepartmentID%>" onpropertychange="javascript:addPersonnel();">
- <iframe id="SelectDepartment" frameborder=1 src="/SelectDepartment.jsp" width="100%" height="100%" scrolling="auto"></iframe>
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">员工姓名:</font></td>
- <td align="left" valign="middle" nowrap> <select name="PersonnelID">
- <option value="0">请先选择所属部门再选择员工</option>
- </select> </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">用户名称:</font></td>
- <td align="left" valign="middle" nowrap> <input name="UserName" type="text" maxlength="50" size="20" value="<%=((Vector)vt.get(0)).get(1).toString()%>">
- <input name="ID" type="Hidden" maxlength="50" size="20" value="<%=((Vector)vt.get(0)).get(0).toString()%>">
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">用户密码:</font></td>
- <td align="left" valign="middle" nowrap><input name="Password" type="Password" value="<%=StringNew.getDisencodePassword(((Vector)vt.get(0)).get(2).toString())%>">
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">确认密码:</font></td>
- <td align="left" valign="middle" nowrap><input name="Password1" type="Password" value="<%=StringNew.getDisencodePassword(((Vector)vt.get(0)).get(2).toString())%>">
- </td>
- </tr>
- <tr>
- <td align="right" valign="middle"><font color="#0A0A0A">用户角色:</font></td>
- <td align="left" valign="middle" nowrap> <select name="RoleID">
- <option value="0">请选择用户角色</option>
- <%
- //检索要选择的用户角色
- Vector vRole = RoleManager.getAllRecord();
- for(int i=0;i<vRole.size();i++)
- {
- if(((Vector)vRole.get(i)).get(0).toString().equalsIgnoreCase(((Vector)vt.get(0)).get(4).toString()))
- {
- out.println("<option value="" + ((Vector)vRole.get(i)).get(0).toString() + "" selected>" + ((Vector)vRole.get(i)).get(1).toString() + "</option>");
- }
- else
- {
- out.println("<option value="" + ((Vector)vRole.get(i)).get(0).toString() + "">" + ((Vector)vRole.get(i)).get(1).toString() + "</option>");
- }
- }
- %>
- </select> </td>
- </tr>
- <tr>
- <td align="right" valign="middle"> </td>
- <td align="left" valign="middle" nowrap> <input type="submit" value="修改">
- <input type="reset" value="重填"> <input type="button" value="返回" onclick="window.location='UserManage.jsp';">
- </td>
- </tr>
- </table>
- </form>
- </td>
- <!-- 去掉右边图片 马登军2003年6月3日
- -->
- </tr>
- </table>
- </body>
- </html>
- <%
- }
- %>