archive_user_modify.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:16k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "java.util.*"%>
  4. <%@ page import = "cn.js.fan.util.*"%>
  5. <%@ page import = "cn.js.fan.web.*"%>
  6. <%@ page import = "com.redmoon.oa.archive.*"%>
  7. <%@ page import = "com.redmoon.oa.BasicDataMgr"%>
  8. <%@ page import = "com.redmoon.oa.person.*"%>
  9. <%@ page import = "cn.js.fan.security.*"%>
  10. <%@ page import="com.redmoon.oa.dept.*" %>
  11. <html xmlns="http://www.w3.org/1999/xhtml">
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  14. <title>人事档案管理</title>
  15. <link href="../common.css" rel="stylesheet" type="text/css">
  16. <style type="text/css">
  17. <!--
  18. .style2 {font-size: 14px}
  19. -->
  20. </style>
  21. <script language="JavaScript" type="text/JavaScript">
  22. <!--
  23. var oldDeptCode = "";
  24. function findObj(theObj, theDoc)
  25. {
  26.   var p, i, foundObj;
  27.   
  28.   if(!theDoc) theDoc = document;
  29.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  30.   {
  31.     theDoc = parent.frames[theObj.substring(p+1)].document;
  32.     theObj = theObj.substring(0,p);
  33.   }
  34.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  35.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  36.     foundObj = theDoc.forms[i][theObj];
  37.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  38.     foundObj = findObj(theObj,theDoc.layers[i].document);
  39.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  40.   
  41.   return foundObj;
  42. }
  43. var GetDate=""; 
  44. function SelectDate(ObjName,FormatDate){
  45. var PostAtt = new Array;
  46. PostAtt[0]= FormatDate;
  47. PostAtt[1]= findObj(ObjName);
  48. GetDate = showModalDialog("../util/calendar/calendar.htm", PostAtt ,"dialogWidth:286px;dialogHeight:221px;status:no;help:no;");
  49. }
  50. function SetDate()
  51. findObj(ObjName).value = GetDate; 
  52. }
  53. function setPerson(deptCode, deptName, user, userRealName)
  54. {
  55. form1.userName.value = user;
  56. form1.userRealName.value = userRealName;
  57. }
  58. function getDept() {
  59. return form1.dept.value;
  60. }
  61. function selDeptCode() {
  62. var code = form1.deptCode.options(form1.deptCode.selectedIndex).value;
  63. if (form1.deptCode.value=="root") {
  64. alert("请选择具体部门!");
  65. form1.deptCode.value = oldDeptCode;
  66. return false;
  67. }
  68. oldDeptCode = code;  
  69. }
  70. function preview(userName)
  71. {
  72. window.location.href='archive_gwy_print.jsp?userName='+userName;
  73. }
  74. //-->
  75. </script>
  76. </head>
  77. <body>
  78. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  79. <jsp:useBean id="archivePrivilege" scope="page" class="com.redmoon.oa.archive.ArchivePrivilege"/>
  80. <%
  81. String userName = ParamUtil.get(request,"userName");
  82. if (userName.trim().equals("") || !SecurityUtil.isValidSqlParam(userName) || userName.length() > 20) {
  83.    out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request,"res.module.archive","warn_username_err_archive")));
  84.    return;
  85. }
  86. %>
  87. <%@ include file="archive_inc_menu_top.jsp"%>
  88. <%
  89. if (!privilege.isUserPrivValid(request, "archive.userinfo")||!archivePrivilege.canAdminUser(request,userName)) {
  90. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "pvg_invalid")));
  91. return;
  92. }
  93. UserInfoDb uid = new UserInfoDb();
  94. uid = uid.getUserInfoDb(userName);
  95. /*
  96. if(uid == null || !uid.isLoaded()){
  97. boolean re = false;
  98. try {
  99.    re = uid.createNewUser();
  100. }
  101. catch (ErrMsgException e) {
  102.    out.print(StrUtil.Alert_Back(e.getMessage()));
  103. }
  104. if (re) {
  105.    out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request,"res.module.archive", "success_add_userinfo"),"archive_user_modify.jsp?userName=" + userName));
  106.    return;
  107. }
  108. }
  109. */
  110. BasicDataMgr bdm = new BasicDataMgr("archive");
  111. String options = "";
  112. %>
  113. <br>
  114. <table width="90%" border="0" align="center" cellPadding="2" cellSpacing="1" bgcolor="#FFFFFF" class="tableframe">
  115.   <form name="form1" action="archive_user_do.jsp?op=modify&userName=<%=uid.getUserName()%>" method="post" encType="multipart/form-data">
  116.     <tbody>
  117.   <tr>
  118. <td colspan="3" class="right-title">修改用户信息</td>
  119.   </tr>
  120.       
  121.       <tr>
  122.         <td width="165" noWrap>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</td>
  123.         <td><input maxlength="100" name="userRealName" size="20" value="<%=uid.getUserRealName()%>" readonly>
  124.           <input name="userName" type="hidden" value="<%=uid.getUserName()%>">
  125.           <input type="hidden" name="oldImage" value="<%=uid.getImage()%>"></td>
  126.         <td width="246" rowspan="8"><%if(uid.getImage().equals("")){%>
  127.           <center>
  128.             暂无照片
  129.           </center>
  130.           <%}else{%>
  131.           <img src="../<%=uid.getImage()%>" width="100" height="140">
  132.         <%}%></td>
  133.       </tr>
  134.       <tr>
  135.         <td noWrap><p>所在部门:</p>
  136.         </td>
  137.         <td><select name="deptCode" onChange="return selDeptCode()">
  138. <%
  139.     DeptMgr dir = new DeptMgr();
  140. DeptDb leaf = dir.getDeptDb(uid.getDeptCode());
  141. DeptDb rootlf = leaf.getDeptDb(DeptDb.ROOTCODE);
  142. DeptView dv = new DeptView(rootlf);
  143. dv.ShowDeptAsOptions(out, rootlf, rootlf.getLayer());
  144. %>
  145. </select>
  146.     <script language="JavaScript">
  147. <!--
  148. form1.deptCode.value="<%=uid.getDeptCode()%>";
  149. //-->
  150. </script>
  151. </td>
  152.       </tr>
  153.       <tr>
  154.         <td noWrap>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
  155.         <td width="452"><select name="sex">
  156.             <option value="女">女</option>
  157.             <option value="男" selected>男</option>
  158.           </select>
  159. <script language="JavaScript">
  160. <!--
  161. form1.sex.value="<%=uid.getSex()%>";
  162. //-->
  163. </script> </td>
  164.       </tr>
  165.       <tr>
  166.         <td noWrap>出生日期:</td>
  167.         <td><input maxLength="100" name="birthday" size="20" value="<%=DateUtil.format(uid.getBirthday(),"yyyy-MM-dd")%>"><img style="CURSOR: hand" onClick="SelectDate('birthday', 'yyyy-MM-dd')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  168.           日期格式形如 1999-1-2</td>
  169.       </tr>
  170.   <tr>
  171.         <td noWrap>民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族:</td>
  172.         <td><%options = bdm.getOptionsStr("people");%>
  173.   <select name="people">
  174.   <%=options%>
  175.           </select>
  176. <script language="JavaScript">
  177. <!--
  178. form1.people.value="<%=uid.getPeople()%>";
  179. //-->
  180. </script>
  181.   </td>
  182.       </tr>
  183.       <tr>
  184.         <td noWrap>籍&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;贯:</td>
  185.         <td><input maxLength="100" size="12" name="nation" value="<%=uid.getNation()%>"></td>
  186.       </tr>
  187.       <tr>
  188.         <td noWrap>出&nbsp;&nbsp;生&nbsp;&nbsp;地:</td>
  189.         <td><input maxLength="100" size="12" name="born" value="<%=uid.getBorn()%>"></td>
  190.       </tr>
  191.       <tr>
  192.         <td noWrap>入党时间:</td>
  193.         <td><input maxLength="100" name="joinPartyDate" size="20" value="<%=DateUtil.format(uid.getJoinPartyDate(),"yyyy-MM")%>"><img style="CURSOR: hand" onClick="SelectDate('joinPartyDate', 'yyyy-MM')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  194.           日期格式形如 1999-1-2</td>
  195.       </tr>
  196.       <tr>
  197.         <td noWrap>参加工作时间:</td>
  198.         <td colSpan="3"><input maxLength="100" name="joinWorkDate" size="20" value="<%=DateUtil.format(uid.getJoinWorkDate(),"yyyy-MM")%>"><img style="CURSOR: hand" onClick="SelectDate('joinWorkDate', 'yyyy-MM')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  199.           日期格式形如 1999-1-2</td>
  200.       </tr>
  201.         <tr>
  202.         <td noWrap>加入本单位时间:</td>
  203.         <td colSpan="2"><input maxLength="100" name="joinDepartmentDate" size="20" value="<%=DateUtil.format(uid.getJoinDepartmentDate(),"yyyy-MM")%>"><img style="CURSOR: hand" onClick="SelectDate('joinDepartmentDate', 'yyyy-MM')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  204.           日期格式形如 1999-1-2</td>
  205.       </tr>
  206.       <tr>
  207.         <td noWrap>在职情况:</td>
  208.         <td colSpan="2">
  209. <%options = bdm.getOptionsStr("inactiveservice");%>
  210.   <select name="inActiveService">
  211.   <%=options%>
  212.           </select> 
  213. <script language="JavaScript">
  214. <!--
  215. form1.inActiveService.value="<%=uid.getInActiveService()%>";
  216. //-->
  217. </script> </td>
  218.       </tr>
  219.       <tr>
  220.         <td noWrap>健康状况:</td>
  221.         <td colSpan="3">
  222. <%options = bdm.getOptionsStr("healthstate");%>
  223.   <select name="healthState">
  224.   <%=options%>
  225.           </select>
  226. <script language="JavaScript">
  227. <!--
  228. form1.healthState.value="<%=uid.getHealthState()%>";
  229. //-->
  230. </script> </td>
  231.       </tr>
  232.   <tr>
  233.         <td noWrap>最高学历:</td>
  234.         <td colSpan="2">   
  235.   <%options = bdm.getOptionsStr("grade");%>
  236.   <select name="mostGrade">
  237.   <%=options%>
  238.           </select>
  239. <script language="JavaScript">
  240. <!--
  241. form1.mostGrade.value="<%=uid.getMostGrade()%>";
  242. //-->
  243. </script>
  244. </td>
  245.       </tr>
  246.       <tr>
  247.         <td noWrap>文化程度:</td>
  248.         <td colSpan="3">
  249. <%options = bdm.getOptionsStr("culture");%>
  250.   <select name="culture">
  251.   <%=options%>
  252.           </select>
  253. <script language="JavaScript">
  254. <!--
  255. form1.culture.value="<%=uid.getCulture()%>";
  256. //-->
  257. </script>   </td>
  258.       </tr>
  259.       <tr>
  260.         <td noWrap>后备干部级别:</td>
  261.         <td colSpan="3">
  262. <%options = bdm.getOptionsStr("insupportcadrelevel");%>
  263.   <select name="insupportCadreLevel">
  264.   <%=options%>
  265.           </select>
  266. <script language="JavaScript">
  267. <!--
  268. form1.insupportCadreLevel.value="<%=uid.getInsupportCadreLevel()%>";
  269. //-->
  270. </script>   </td>
  271.       </tr>
  272.       <tr>
  273.         <td noWrap>定为后备干部的时间:</td>
  274.         <td colSpan="3"><input maxLength="100" name="insupportCadreDate" size="20" value="<%=DateUtil.format(uid.getInsupportCadreDate(),"yyyy-MM")%>"><img style="CURSOR: hand" onClick="SelectDate('insupportCadreDate', 'yyyy-MM')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  275.           日期格式形如 1999-1-2</td>
  276.       </tr>
  277.       <tr>
  278.         <td noWrap>政治面貌:</td>
  279.         <td colSpan="3">
  280. <%options = bdm.getOptionsStr("polity");%>
  281.   <select name="polity">
  282.   <%=options%>
  283.           </select>
  284. <script language="JavaScript">
  285. <!--
  286. form1.polity.value="<%=uid.getPolity()%>";
  287. //-->
  288. </script>   </td>  
  289.       </tr>
  290.       <tr>
  291.         <td noWrap>其它党派加入时间:</td>
  292.         <td colSpan="3"><input maxLength="100" name="joinClanDate" size="20" value="<%=DateUtil.format(uid.getJoinClanDate(),"yyyy-MM")%>"><img style="CURSOR: hand" onClick="SelectDate('joinClanDate', 'yyyy-MM')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  293.           日期格式形如 1999-1-2</td>
  294.       </tr>
  295.       <tr>
  296.         <td noWrap>编制情况:</td>
  297.         <td colSpan="3">
  298. <%options = bdm.getOptionsStr("typeofwork");%>
  299.   <select name="typeOfWork">
  300.   <%=options%>
  301.           </select>
  302. <script language="JavaScript">
  303. <!--
  304. form1.typeOfWork.value="<%=uid.getTypeOfWork()%>";
  305. //-->
  306. </script>   </td>
  307.       </tr>
  308.   <tr>
  309.         <td noWrap>干部来源</td>
  310.         <td colSpan="3"><%options = bdm.getOptionsStr("cadressource");%>
  311.   <select name="cadresSource">
  312.   <%=options%>
  313.           </select>
  314. <script language="JavaScript">
  315. <!--
  316. form1.cadresSource.value="<%=uid.getCadresSource()%>";
  317. //-->
  318. </script></td>
  319.       <tr>
  320.         <td noWrap>过渡时间</td>
  321.         <td colSpan="3"><input maxLength="100" name="transitionDate" size="20" value="<%=DateUtil.format(uid.getTransitionDate(),"yyyy-MM")%>"><img style="CURSOR: hand" onClick="SelectDate('transitionDate', 'yyyy-MM')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">  
  322.           日期格式形如 1999-1-2</td>
  323.       </tr>
  324.       <tr>
  325.         <td noWrap>照片</td>
  326.         <td colSpan="3"><input title="选择附件文件" type="file" size="30" name="image"></td>
  327.       </tr>
  328.       <tr>
  329.         <td noWrap>备注:</td>
  330.         <td colSpan="3"><textarea name="remark" cols="45" rows="3" wrap="yes" class="BigINPUT" id="remark"><%=uid.getRemark()%></textarea></td>
  331.       </tr>
  332.       <tr>
  333.         <td noWrap align="middle" colSpan="4"><input value="保存" type="submit">&nbsp;&nbsp; 
  334.           <input type="reset" value="重填">&nbsp;&nbsp;
  335.           <!--<input type="button" value="打印公务员登记表" onClick="UseWord.Open('<%=Global.getRootPath()%>/archive/doc_templ/111.doc')">-->
  336.   </td>
  337.       </tr>
  338.     </tbody>
  339.   </FORM>
  340. </table>
  341. <table style="display:none" width="100%"><tr><td>
  342. <%
  343. String sql = "";
  344. //UserInfoDb uid = new UserInfoDb();
  345. //uid = uid.getUserInfoDb(userName);
  346. if(userName.equals("")){
  347. sql = ArchiveSQLBuilder.getUserStudy();
  348.   }else{
  349. sql = ArchiveSQLBuilder.getUserStudy(userName);
  350. }
  351. UserStudyDb usd = new UserStudyDb();
  352. Iterator ir = usd.list(sql).iterator();
  353. String college = ""; // 全日制教育
  354. String collegeSpecialty = ""; // 全日制教育 毕业院校系及专业
  355. String job = ""; // 在职教育
  356. String zcollegeSpecialty = ""; // 在职教育 毕业院校系及专业
  357. while (ir.hasNext()) {
  358.   usd = (UserStudyDb)ir.next();
  359.   if ((usd.getIsMostGrade()).equals("1")) {
  360.       if (usd.getIsJob().equals("是")) {
  361.   zcollegeSpecialty = usd.getCollege() + usd.getSpecialty();
  362.   job = usd.getGrade();   
  363.   } else {
  364.   collegeSpecialty = usd.getCollege() + usd.getSpecialty();
  365.   college = usd.getGrade();
  366.   }
  367.   } // if end!
  368. } // end 学历学位
  369. // 工作简历
  370. UserResumeDb urd = new UserResumeDb();
  371. Iterator ir1 = urd.list(sql).iterator();
  372. String resume = "";
  373. while (ir1.hasNext()) {
  374.    urd = (UserResumeDb)ir1.next();
  375.    resume += urd.getCompany() + urd.getJob() + DateUtil.format(urd.getBeginDate(),"yyyy-MM-dd") + DateUtil.format(urd.getEndDate(),"yyyy-MM-dd");
  376. } // end 工作简历
  377. // 何时受过何种奖惩 rewards
  378. UserRewardsDb urwd = new UserRewardsDb();
  379. Iterator ir2 = urwd.list(sql).iterator();
  380. String rewards = "";
  381. while (ir2.hasNext()) {
  382.   urwd = (UserRewardsDb)ir2.next();
  383.   rewards += DateUtil.format(urwd.getMyDate(),"yyyy-MM-dd") + urwd.getPlace() + urwd.getRewards() + urwd.getReason();
  384. } // end 何时受过何种奖惩
  385. %>
  386. <OBJECT id=UseWord classid=CLSID:D01B1EDF-E803-46FB-B4DC-90F585BC7EEE 
  387. VIEWASTEXT><PARAM NAME="BackColor" VALUE="0000ff00">
  388. <PARAM NAME="Server" VALUE="localhost">
  389. <PARAM NAME="Port" VALUE="8080">
  390. <PARAM NAME="isAutoUpload" VALUE="0" />
  391. <PARAM NAME="isConfirmUpload" VALUE="1" />
  392. <PARAM NAME="PostScript" VALUE="">
  393. <PARAM NAME="WordUrl" VALUE="">
  394. </OBJECT>
  395. </td></tr></table>
  396. </body>
  397. <script language=javascript>
  398. function doalert() {
  399. //UseWord.Alert("ff");
  400. }
  401. function OnDocOpen() {
  402. UseWord.SetWordBookmarkText("realName", "<%=uid.getUserRealName()%>");
  403. UseWord.SetWordBookmarkText("sex", "<%=uid.getSex()%>");
  404. UseWord.SetWordBookmarkText("birthday", "<%=uid.getBirthday()%>");
  405. UseWord.SetWordBookmarkText("nation", "<%=uid.getNation()%>");
  406. UseWord.SetWordBookmarkText("people", "<%=uid.getPeople()%>");
  407. UseWord.SetWordbookmarkText("polity", "<%=uid.getPolity()%>");
  408. UseWord.SetWordbookmarkText("healthState", "<%=uid.getHealthState()%>");
  409. UseWord.SetWordbookmarkText("joinDepartmentDate", "<%=uid.getJoinDepartmentDate()%>");
  410. UseWord.SetWordbookmarkText("inactiveService", "<%=uid.getInActiveService()%>");
  411. UseWord.SetWordbookmarkText("resume", "<%=resume%>");
  412. UseWord.SetWordbookmarkText("rewards", "<%=rewards%>");
  413. }
  414. function getBookMark() {
  415. //var str = UseWord.GetWordBookmarkText("realName");
  416. //alert(str);
  417. }
  418. </script>
  419. </html>