EditPersonnel.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:13k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <%
  5. Request m_request = new Request(request);
  6. int intPersonnelID = m_request.GetInt("ID");
  7. if(intPersonnelID<1)
  8. {
  9. %>
  10. <script language="JavaScript" type="text/JavaScript">
  11. alert("请选择正确的员工,修改失败!");
  12. history.back();
  13. </script>
  14. <%
  15. }
  16. else
  17. {
  18. Vector vt = PersonnelManager.getRecordByID(intPersonnelID);
  19. if(vt.size()==1)
  20. {
  21. %>
  22. <html>
  23. <head>
  24. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  25. <title>员工管理-- GForce OA 2.0</title>
  26. <link href="../css/txt.jsp" rel="stylesheet" type="text/css">
  27. <script language="JavaScript" src="/js/changestyle.js"></script>
  28. <SCRIPT language="JavaScript" src="/Calendar/PopUpCalendarDlg.js"></SCRIPT>
  29. <script language="JavaScript" type="text/javascript">
  30. function checkEditPersonnel()
  31. {
  32.     if(document.editpersonnel.Number.value=="")
  33.     {
  34.         alert("请输入员工编号!");
  35.         document.editpersonnel.Number.focus();
  36.         return false;
  37.     }
  38.     if(document.editpersonnel.Name.value=="")
  39.     {
  40.         alert("请输入姓名!");
  41.         document.editpersonnel.Name.focus();
  42.         return false;
  43.     }
  44.     if(document.editpersonnel.DepartmentID.value=="")
  45.     {
  46.         alert("请选择所属部门!");
  47.         document.editpersonnel.DepartmentID.focus();
  48.         return false;
  49.     }
  50.     if(document.editpersonnel.EducationID.value=="0")
  51.     {
  52.         alert("请选择教育程度!");
  53.         document.editpersonnel.EducationID.focus();
  54.         return false;
  55.     }
  56.     if(document.editpersonnel.MarriageID.value=="0")
  57.     {
  58.         alert("请选择婚姻状况!");
  59.         document.editpersonnel.MarriageID.focus();
  60.         return false;
  61.     }
  62.     if(document.editpersonnel.PlaceID.value<1)
  63.     {
  64.         alert("请选择职务!");
  65.         document.editpersonnel.PlaceID.focus();
  66.         return false;
  67.     }
  68.     if(document.editpersonnel.TechnicalPostID.value=="0")
  69.     {
  70.         alert("请选择职称!");
  71.         document.editpersonnel.TechnicalPostID.focus();
  72.         return false;
  73.     }
  74.     if(document.editpersonnel.BirthDate.value!="")
  75.     {
  76.         if(!isDate(document.editpersonnel.BirthDate.value))
  77.         {
  78.             alert("日期格式错误,请按照“2002-02-18”重新输入!");
  79.             document.editpersonnel.BirthDate.focus();
  80.             return false;
  81.         }
  82.     }
  83. }
  84. var arrayPlace = new Array();
  85. <%
  86. Vector vPlace = PlaceManager.getAllRecord();
  87. for(int i=0;i<vPlace.size();i++)
  88. {
  89.     out.println("arrayPlace["+ i +"]=new Array("" + ((Vector)vPlace.get(i)).get(0).toString() + "","" + ((Vector)vPlace.get(i)).get(1).toString() + "","" + ((Vector)vPlace.get(i)).get(2).toString() + "");");
  90. }
  91. %>
  92. function addPlace()
  93. {
  94.     with(document.editpersonnel)
  95.     {
  96.     PlaceID.length=1;
  97.     PlaceID.selectedIndex=0;
  98.     for(var i=0;i < arrayPlace.length;i++)
  99.     {
  100.        if(arrayPlace[i][2]==DepartmentID.value)
  101.         {
  102.             var oOption = document.createElement("OPTION");
  103.             PlaceID.options.add(oOption);
  104.             oOption.innerText = arrayPlace[i][1];
  105.             oOption.value = arrayPlace[i][0];
  106.             if(arrayPlace[i][0]=="<%=((Vector)vt.get(0)).get(16).toString()%>")
  107.             {
  108.                 oOption.selected=true;
  109.             }
  110.         }
  111.     }
  112.     }
  113. }
  114. </script>
  115. </head>
  116. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0" onload="javascript:addPlace();">
  117. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  118.     <tr>
  119.         <td align="center" valign="top"><p>&nbsp;</p>
  120.             <form name="editpersonnel" action="EditPersonnelAction.jsp" method="post" onSubmit="javascript:return checkEditPersonnel();">
  121.         <table width="95%"  border="1" align="center" cellpadding="0" cellspacing="0">
  122.           <tr>
  123.             <td width="17%" align="right" valign="middle"><font color="#0A0A0A">员工编号:</font></td>
  124.             <td width="30%" align="left" valign="middle" nowrap>
  125.               <input name="ID" type="hidden"  value="<%=((Vector)vt.get(0)).get(0).toString()%>">
  126.               <input name="Number" type="text" maxlength="50" size="20" value="<%=((Vector)vt.get(0)).get(4).toString()%>">
  127.             </td>
  128.             <td width="12%" rowspan="5" align="right" valign="middle" nowrap><font color="#0A0A0A">所属部门:</font></td>
  129.             <td width="41%" rowspan="5" align="left" valign="middle" nowrap>
  130.                 <input type="hidden" name="DepartmentID" id="DepartmentID" value="<%=((Vector)vt.get(0)).get(13).toString()%>" onpropertychange="javascript:addPlace();">
  131.                     <iframe id="SelectDepartment" frameborder=1 src="/SelectDepartment.jsp" width="100%" height="100%" scrolling="auto"></iframe>
  132.             </td>
  133.           </tr>
  134.           <tr>
  135.             <td align="right" valign="middle"><font color="#0A0A0A">担任职务:</font></td>
  136.             <td align="left" valign="middle" nowrap> <select name="PlaceID">
  137.                 <option value="0">请先选择所属部门再选择职务</option>
  138.               </select> </td>
  139.           </tr>
  140.           <tr>
  141.             <td align="right" valign="middle"><font color="#0A0A0A">员工姓名:</font></td>
  142.             <td align="left" valign="middle" nowrap> <input name="Name" type="text" maxlength="50" size="20" value="<%=((Vector)vt.get(0)).get(1).toString()%>">
  143.             </td>
  144.           </tr>
  145.           <tr>
  146.             <td align="right" valign="middle"><font color="#0A0A0A">员工性别:</font></td>
  147.             <td align="left" valign="middle" nowrap> <font color="#0A0A0A">
  148.               <input name="Sex" type="radio" value="男" <%if(((Vector)vt.get(0)).get(2).toString().equalsIgnoreCase("男"))out.print("checked");%>>
  149.               男&nbsp;
  150.               <input name="Sex" type="radio" value="女" <%if(((Vector)vt.get(0)).get(2).toString().equalsIgnoreCase("女"))out.print("checked");%> >
  151.               女</font> </td>
  152.           </tr>
  153.           <tr>
  154.             <td align="right" valign="middle"><font color="#0A0A0A">出生日期:</font></td>
  155.             <td align="left" valign="middle" nowrap> <input name="BirthDate" type="text" value="<%=StringNew.GetDateString(((Vector)vt.get(0)).get(3).toString(),"yyyy-MM-dd")%>"  onFocus="JavaScript:this.value=fPopUpCalendarDlg(this.value,-100,-2);" maxlength="20" size="20" onDblClick="JavaScript:this.value=fPopUpCalendarDlg(this.value,-100,-2);">
  156.             </td>
  157.           </tr>
  158.           <tr>
  159.             <td align="right" valign="middle"><font color="#0A0A0A">身份证号码:</font></td>
  160.             <td align="left" valign="middle" nowrap> <input name="IDCard" type="text" maxlength="18" size="20" value="<%=((Vector)vt.get(0)).get(7).toString()%>">
  161.             </td>
  162.             <td rowspan="4" align="right" valign="middle" nowrap><font color="#0A0A0A">照片预览:</font></td>
  163.             <td rowspan="4" align="center" valign="middle" nowrap onclick="return uploadimage(document.editpersonnel.Photo,document.all.PhotoIMG);"><img src="<%=((Vector)vt.get(0)).get(18).toString().length()<1?"/images/no_pic.gif":((Vector)vt.get(0)).get(18).toString()%>" id="PhotoIMG" height="100"><br>
  164.               <font color="#0A0A0A">上传照片 </font></td>
  165.           </tr>
  166.           <tr>
  167.             <td align="right" valign="middle"><font color="#0A0A0A">婚姻状况:</font></td>
  168.             <td align="left" valign="middle" nowrap> <select name="MarriageID">
  169.                 <option value="0" selected>请选择婚姻状况</option>
  170.                 <%
  171. //检索要选择的婚姻状况
  172. Vector vMarriage = MarriageStateManager.getAllRecord();
  173. for(int i=0;i<vMarriage.size();i++)
  174. {
  175. if (((Vector)vMarriage.get(i)).get(0).toString().equalsIgnoreCase(((Vector)vt.get(0)).get(15).toString()))
  176.         out.println("<option value="" + ((Vector)vMarriage.get(i)).get(0).toString() + ""selected>" + ((Vector)vMarriage.get(i)).get(1).toString() + "</option>");
  177.         else
  178.         out.println("<option value="" + ((Vector)vMarriage.get(i)).get(0).toString() + "">" + ((Vector)vMarriage.get(i)).get(1).toString() + "</option>");
  179. }
  180. %>
  181.               </select> </td>
  182.           </tr>
  183.           <tr>
  184.             <td align="right" valign="middle"><font color="#0A0A0A">教育程度:</font></td>
  185.             <td align="left" valign="middle" nowrap> <select name="EducationID">
  186.                 <option value="0" selected>请选择教育程度</option>
  187.                 <%
  188. //检索要选择的教育程度
  189. Vector vEducation = EducationManager.getAllRecord();
  190. for(int i=0;i<vEducation.size();i++)
  191. {
  192. if(((Vector)vEducation.get(i)).get(0).toString().equalsIgnoreCase(((Vector)vt.get(0)).get(14).toString()))
  193.         out.println("<option value="" + ((Vector)vEducation.get(i)).get(0).toString() + ""selected>" + ((Vector)vEducation.get(i)).get(1).toString() + "</option>");
  194.         else
  195.         out.println("<option value="" + ((Vector)vEducation.get(i)).get(0).toString() + "">" + ((Vector)vEducation.get(i)).get(1).toString() + "</option>");
  196. }
  197. %>
  198.               </select> </td>
  199.           </tr>
  200.           <tr>
  201.             <td align="right" valign="middle"><font color="#0A0A0A">最高职称:</font></td>
  202.             <td align="left" valign="middle" nowrap> <select name="TechnicalPostID">
  203.                 <option value="0" selected>请选择职称</option>
  204.                 <%
  205. //检索要选择的职称
  206. Vector vTechnicalPost = TechnicalPostManager.getAllRecord();
  207. for(int i=0;i<vTechnicalPost.size();i++)
  208. {
  209. if (((Vector)vTechnicalPost.get(i)).get(0).toString().equalsIgnoreCase(((Vector)vt.get(0)).get(17).toString()))
  210.         out.println("<option value="" + ((Vector)vTechnicalPost.get(i)).get(0).toString() + ""selected>" + ((Vector)vTechnicalPost.get(i)).get(1).toString() + "</option>");
  211.         else
  212.         out.println("<option value="" + ((Vector)vTechnicalPost.get(i)).get(0).toString() + "">" + ((Vector)vTechnicalPost.get(i)).get(1).toString() + "</option>");
  213. }
  214. %>
  215.               </select> </td>
  216.           </tr>
  217.           <tr>
  218.             <td align="right" valign="middle"><font color="#0A0A0A">E-Mail:</font></td>
  219.             <td align="left" valign="middle" nowrap> <input name="EMail" type="text" maxlength="60" size="20" value="<%=((Vector)vt.get(0)).get(9).toString()%>">
  220.             </td>
  221.             <td align="right" valign="middle" nowrap><font color="#0A0A0A">员工照片:</font></td>
  222.             <td align="left" valign="middle" nowrap><input name="Photo" type="text" maxlength="50" size="20" value="<%=((Vector)vt.get(0)).get(18).toString()%>" onchange="javascript:document.all.PhotoIMG.src=this.value==''?'/images/no_pic.gif':this.value;"><a href="" onclick="return uploadimage(document.editpersonnel.Photo,document.all.PhotoIMG);"><font color="#0A0A0A">上传照片</font></a></td>
  223.           </tr>
  224.           <tr>
  225.             <td align="right" valign="middle"><font color="#0A0A0A">办公室电话:</font></td>
  226.             <td align="left" valign="middle" nowrap> <input name="OfficeTel" type="text" maxlength="60" size="20" value="<%=((Vector)vt.get(0)).get(5).toString()%>">
  227.             </td>
  228.             <td align="right" valign="middle"><font color="#0A0A0A">移动电话:</font></td>
  229.             <td align="left" valign="middle" nowrap> <input name="HomeTel" type="text" maxlength="60" size="20" value="<%=((Vector)vt.get(0)).get(6).toString()%>">
  230.             </td>
  231.           </tr>
  232.           <tr>
  233.             <td align="right" valign="middle"><font color="#0A0A0A">家庭住址:</font></td>
  234.             <td colspan="3" align="left" valign="middle" nowrap> <input name="HomeAddress" type="text" maxlength="100" size="60" value="<%=((Vector)vt.get(0)).get(8).toString()%>">
  235.             </td>
  236.           </tr>
  237.           <tr>
  238.             <td align="right" valign="middle"><font color="#0A0A0A">个人简历:</font></td>
  239.             <td colspan="3" align="left" valign="middle" nowrap> <textarea name="Resume" cols="40" rows="5" id="Resume"><%=((Vector)vt.get(0)).get(10).toString()%></textarea>
  240.             </td>
  241.           </tr>
  242.           <tr>
  243.             <td align="right" valign="middle"><font color="#0A0A0A">备注:</font></td>
  244.             <td colspan="3" align="left" valign="middle" nowrap> <textarea name="Remark" cols="40" rows="5" id="Remark" maxlength="20"><%=((Vector)vt.get(0)).get(11).toString()%></textarea>
  245.               <input name="Remark1" type="hidden"> </td>
  246.           </tr>
  247.           <tr>
  248.             <td align="right" valign="middle">&nbsp;</td>
  249.             <td colspan="3" align="left" valign="middle" nowrap> <input type="submit" value="修改">
  250.               &nbsp;&nbsp; <input type="reset" value="重填"> &nbsp;&nbsp; <input type="button" value="返回" onclick="window.location='PersonnelManage.jsp';">
  251.             </td>
  252.           </tr>
  253.         </table>
  254.             </form>
  255.         </td>
  256. <!--  去掉右边图片   马登军2003年6月3日
  257. -->
  258.     </tr>
  259. </table>
  260. </body>
  261. </html>
  262. <%
  263. }
  264. else
  265. {
  266. %>
  267. <script language="JavaScript" type="text/JavaScript">
  268. alert("该记录已经被删除或者您没有权限修改此记录,修改失败!");
  269. history.back();
  270. </script>
  271. <%
  272. }
  273. }
  274. %>