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