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

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 = "com.redmoon.oa.archive.*"%>
  6. <%@ page import = "com.redmoon.oa.person.*"%>
  7. <%@ page import = "cn.js.fan.web.*"%>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title>任免添加</title>
  13. <link href="../common.css" rel="stylesheet" type="text/css">
  14. <script language="JavaScript" type="text/JavaScript">
  15. <!--
  16. function findObj(theObj, theDoc)
  17. {
  18.   var p, i, foundObj;
  19.   
  20.   if(!theDoc) theDoc = document;
  21.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  22.   {
  23.     theDoc = parent.frames[theObj.substring(p+1)].document;
  24.     theObj = theObj.substring(0,p);
  25.   }
  26.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  27.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  28.     foundObj = theDoc.forms[i][theObj];
  29.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  30.     foundObj = findObj(theObj,theDoc.layers[i].document);
  31.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  32.   
  33.   return foundObj;
  34. }
  35. var GetDate=""; 
  36. function SelectDate(ObjName,FormatDate){
  37. var PostAtt = new Array;
  38. PostAtt[0]= FormatDate;
  39. PostAtt[1]= findObj(ObjName);
  40. GetDate = showModalDialog("../util/calendar/calendar.htm", PostAtt ,"dialogWidth:286px;dialogHeight:221px;status:no;help:no;");
  41. }
  42. function SetDate()
  43. findObj(ObjName).value = GetDate; 
  44. }
  45. function chkContent(){
  46.    if(form1.userName.value == ""){
  47.      alert("用户名不能为空!")
  48.  form1.userName.focus();
  49.  return false
  50.    }
  51. }
  52. function setPerson(deptCode, deptName, user, userRealName)
  53. {
  54. form1.userName.value = user;
  55. form1.userRealName.value = userRealName;
  56. }
  57. //-->
  58. </script>
  59. <style type="text/css">
  60. <!--
  61. .style2 {font-size: 14px}
  62. -->
  63. </style>
  64. </head>
  65. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  66. <jsp:useBean id="archivePrivilege" scope="page" class="com.redmoon.oa.archive.ArchivePrivilege"/>
  67. <% 
  68. String userName = ParamUtil.get(request,"userName");
  69.     if (!privilege.isUserPrivValid(request, "archive.duty")||!archivePrivilege.canAdminUser(request,userName)) {
  70. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "pvg_invalid")));
  71. return;
  72. }
  73. String op = ParamUtil.get(request,"op");
  74. if (op.equals("add")) {
  75. UserDutyMgr udm = new UserDutyMgr();
  76. boolean re = false;
  77. try {  
  78. re = udm.create(request);
  79. }
  80. catch(ErrMsgException e){
  81. out.print(StrUtil.Alert(e.getMessage()));
  82. }
  83. if (re) {
  84. out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request,"res.module.archive", "success_add_duty"),"archive_duty_list.jsp?userName=" + userName));
  85. }
  86. %>
  87. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  88. <%@ include file="archive_inc_menu_top.jsp"%>
  89. <%
  90. UserInfoDb uid = new UserInfoDb();
  91. uid = uid.getUserInfoDb(userName);
  92. String userRealName = uid.getUserRealName();
  93. %>
  94. <br>
  95. <table class="main" cellSpacing="1" cellPadding="2" width="600" align="center" border="0">
  96. <form action="?op=add" name="form1" method="post">
  97.   <tbody>
  98.     <tr>
  99.       <td colspan="2" noWrap class="right-title">添加任免信息</td>
  100.     </tr>
  101.     <tr>
  102.       <td width="80" noWrap>用&nbsp;&nbsp;户&nbsp;&nbsp;名:</td>
  103.       <td colSpan="2"><input maxLength="100" name="userRealName" size="20" readonly value="<%=userRealName%>"><input name="userName" type="hidden" value="<%=userName%>"></td>
  104.     </tr>
  105.     <tr>
  106.       <td class="TableContent" noWrap>现任职务:</td>
  107.       <td class="TableData"><input name="info" id="info" size="36" maxlength="200"></td>
  108.     </tr>
  109.     <tr>
  110.       <td class="TableContent" noWrap>拟任职务:</td>
  111.       <td class="TableData"><input name="duty" id="duty" size="36" maxLength="200"></td>
  112.     </tr>
  113.     <tr>
  114.       <td class="TableContent" noWrap>拟免职务:</td>
  115.       <td class="TableData"><input name="deposal" id="deposal" size="36" maxLength="200"></td>
  116.     </tr>
  117.     <tr>
  118.       <td class="TableContent" noWrap>任免时间:</td>
  119.       <td class="TableData">
  120.   <%
  121.   UserDutyDb udd = new UserDutyDb();
  122.   Vector vt = udd.list(ArchiveSQLBuilder.getUserDuty(userName));
  123.   if(vt.size()==0){
  124.   %>
  125.   <input name="myDate" id="myDate" size="20" value="1994-9-1">
  126.   <%
  127.       }else{
  128.   %>
  129.   <input name="myDate" id="myDate" size="20">
  130.   <%
  131.       }
  132.   %>
  133.         <img style="CURSOR: hand" onClick="SelectDate('myDate', 'yyyy-MM-dd')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26">日期格式形如 1999-1-2</td>
  134.     </tr>
  135.     <tr>
  136.       <td class="TableContent" noWrap>任免文号:</td>
  137.       <td class="TableData"><input name="fileNumber" id="fileNumber" size="36" maxLength="200"></td>
  138.     </tr>
  139.     
  140.     <tr>
  141.       <td class="TableContent" noWrap>备注:</td>
  142.       <td class="TableData"><textarea name="remark" cols="45" rows="3" wrap="yes" class="BigINPUT" id="remark"></textarea></td>
  143.     </tr>
  144.     <tr class="TableControl" align="middle">
  145.       <td colSpan="2" align="center" noWrap><input name="submit" type="submit" class="BigButton" value="提交" onClick="return chkContent()">
  146.         &nbsp;&nbsp;
  147.           <input name="button" type="reset" class="BigButton" value="重填">
  148.         &nbsp;&nbsp;&nbsp;&nbsp;</td>
  149.     </tr>
  150.   </tbody>
  151.   </form>
  152. </table>
  153. </body>
  154. </html>