Address_Employe_Create.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:9k
源码类别:

电子政务应用

开发平台:

Java

  1. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  2. <%
  3.   int companyId = 0;
  4.   if(request.getParameter("companyId")!=null && !request.getParameter("companyId").equals(""))
  5.     companyId = Integer.parseInt(request.getParameter("companyId"));
  6. %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  8. <HTML>
  9. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  10. </HEAD>
  11. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  12. <script language="javascript" src="/vnex/validate.js" ></script>
  13. <script language=JavaScript>
  14. function isDigit (c)
  15. {   
  16.   return ((c >= "0") && (c <= "9"))
  17. }
  18. function isInteger (s)
  19. {   
  20.     var i;
  21.     for (i = 0; i < s.length; i++)
  22.     {
  23.         var c = s.charAt(i);
  24.         if (!isDigit(c)) return false;
  25.     }
  26.     return true;
  27. }
  28. function isValidChar(str)
  29. {
  30.   var i,j,strTemp;
  31.   strTemp="<>/\";
  32.   for (i=0;i<str.length;i++)
  33.   {
  34.     j=strTemp.indexOf(str.charAt(i));
  35.     if (j!=-1)
  36.     {
  37.       return false;
  38.     }
  39.   }
  40.   return true;
  41. }
  42. function isValidChar2(str)
  43. {
  44.   var i,j,strTemp;
  45.   strTemp="'";
  46.   for (i=0;i<str.length;i++)
  47.   {
  48.     j=strTemp.indexOf(str.charAt(i));
  49.     if (j!=-1)
  50.     {
  51.       return false;
  52.     }
  53.   }
  54.   return true;
  55. }
  56. function check()
  57. {
  58.   if (!stripWhitespace(document.myform.employeName.value) || document.myform.employeName.value=="" || document.myform.employeName.value.length>50)
  59. {
  60.   alert("职工姓名不能为空,并且少于50个字。");
  61.   document.myform.employeName.focus();
  62.   return false;
  63. }
  64. if (document.myform.employeDepartment.value.length>50)
  65. {
  66.   alert("部门应少于50个字。");
  67.   document.myform.employeDepartment.focus();
  68.   return false;
  69. }
  70. if (!isValidChar2(document.myform.employeDepartment.value))
  71. {
  72.   alert("部门不应该包含 ' (单引号)特殊字符。");
  73.   document.myform.employeDepartment.focus();
  74.   return false;
  75. }
  76. if (document.myform.employeDuty.value.length>50)
  77. {
  78.   alert("职务应少于50个字。");
  79.   document.myform.employeDuty.focus();
  80.   return false;
  81. }
  82. if (document.myform.employeExtension.value.length>10 || !isInteger(document.myform.employeExtension.value))
  83. {
  84.   alert("分机应是少于10位的数字。");
  85.   document.myform.employeExtension.focus();
  86.   return false;
  87. }
  88. if (document.myform.employePager.value.length>20)
  89. {
  90.   alert("呼机应少于20位。");
  91.   document.myform.employePager.focus();
  92.   return false;
  93. }
  94. if (document.myform.employeHandset.value.length>20)
  95. {
  96.   alert("手机应少于20位。");
  97.   document.myform.employeHandset.focus();
  98.   return false;
  99. }
  100. if (document.myform.employeOffice.value.length>50)
  101. {
  102.   alert("办公室应少于50个字。");
  103.   document.myform.employeOffice.focus();
  104.   return false;
  105. }
  106. if(document.myform.employeEmail.value.length!=0)
  107. {
  108.   if (document.myform.employeEmail.value.length<6 || document.myform.employeEmail.value.indexOf('@', 0) == -1 || document.myform.employeEmail.value.indexOf('.', 0) == -1)
  109.   {
  110.     alert("Email格式不对。");
  111.     document.myform.employeEmail.focus();
  112.     return false;
  113.   }
  114. }
  115.   if(!isValidChar(myform.employeName.value) || !isValidChar(myform.employeDepartment.value) || !isValidChar(myform.employeDuty.value) 
  116.      || !isValidChar(myform.employePager.value) || !isValidChar(myform.employeHandset.value) || !isValidChar(myform.employeOffice.value) || !isValidChar(myform.employeEmail.value))
  117.   {
  118.     alert("输入内容不能包括 < > / \ 这些特殊字符。");
  119.     return false;
  120.   }
  121.   return true;
  122. }
  123. function createEmploye()
  124. {
  125.  if( !check() )
  126.  {
  127.    return false;
  128.  }
  129.  myform.action= "/mainctrl/commoninfo/addresslist/createAddressEmployeSuccess";
  130.   myform.submit();
  131. }
  132. </script>
  133. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  134. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  135. <DIV align=center>
  136.   <form name="myform" method="post" action="">
  137.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  138.     <TBODY> 
  139.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  140.     <TR> 
  141.         <TD colSpan=3 align="center"><br>
  142.           <!--个人信息开始 -->
  143.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  144.              <tr bgcolor="#fafafa">
  145.               <td>
  146.                 <table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666">
  147.                   <tr>
  148.                     <td><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;
  149.                       <a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>&gt;&gt;<a href="/mainctrl/commoninfo/addresslist/getAddressList"><font color="#FFFFFF">外部通讯录</font></a>&gt;&gt;添加公司职员</font></td>
  150.                   </tr>
  151.                 </table>
  152.                 <table class=title width="600" border="0" cellspacing="1" cellpadding="2">
  153.                   <tr bgcolor="#fafafa"> 
  154.                     <td width="17%"> 
  155.                       <font class="strong">&nbsp;姓名: </font>
  156.                     </td>
  157.                     <td width="83%"> 
  158.                       <input type="text" size="24" name="employeName" class="file">&nbsp;*&nbsp;(注:带*为必填内容)
  159.                     </td>
  160.                   </tr>
  161.                   <tr bgcolor="#e0e0e0"> 
  162.                     <td> 
  163.                       <font class="strong">&nbsp;部门:</font>
  164.                     </td>
  165.                     <td>
  166.                       <input type="text" size="24" name="employeDepartment" class="file">
  167.                     </td>
  168.                   </tr>
  169.                   <tr bgcolor="#fafafa"> 
  170.                     <td> 
  171.                       <font class="strong">&nbsp;职务:</font>
  172.                     </td>
  173.                     <td>
  174.                       <input type="text" size="24" name="employeDuty" class="file">
  175.                     </td>
  176.                   </tr>
  177.                   <tr bgcolor="#e0e0e0"> 
  178.                     <td> 
  179.                       <font  class="strong">&nbsp;分机:</font>
  180.                     </td>
  181.                     <td>
  182.                       <input type="text" size="24" name="employeExtension" class="file">
  183.                     </td>
  184.                   </tr>
  185.                   <tr bgcolor="#fafafa"> 
  186.                     <td> 
  187.                       <font  class="strong">&nbsp;呼机:</font>
  188.                     </td>
  189.                     <td> 
  190.                       <input type="text" size="24" name="employePager" class="file">
  191.                     </td>
  192.                   </tr>
  193.                   <tr bgcolor="#e0e0e0"> 
  194.                     <td> 
  195.                       <font  class="strong">&nbsp;手机:</font>
  196.                     </td>
  197.                     <td> 
  198.                       <input type="text" size="24" name="employeHandset" class="file">
  199.                     </td>
  200.                   </tr>
  201.                   <tr bgcolor="#fafafa"> 
  202.                     <td> 
  203.                       <font  class="strong">&nbsp;办公室:</font>
  204.                     </td>
  205.                     <td> 
  206.                       <input type="text" size="24" name="employeOffice" class="file">
  207.                     </td>
  208.                   </tr>
  209.                   <tr bgcolor="#e0e0e0"> 
  210.                     <td> 
  211.                       <font  class="strong">&nbsp;Email:</font>
  212.                     </td>
  213.                     <td> 
  214.                       <input type="text" size="24" name="employeEmail" class="file" maxlength="50">
  215.                     </td>
  216.                     <input type="hidden" name="companyId" value="<%= companyId%>">
  217.                   </tr>
  218.                   <tr bgcolor="#fafafa"> 
  219.                     <td colspan="2" height="30"> 
  220.                       <div align="center"> 
  221.                         <input type="button" name="Submit" value="保存" class="text" onClick="return createEmploye()">
  222.                         &nbsp;&nbsp;<input type="reset" name="Submit3" value="重置" class="text" >
  223.                         &nbsp;&nbsp;<input type="button" name="Submit2" value="放弃" class="text" onClick="history.back()">
  224.                       </div>
  225.                     </td>
  226.                   </tr>
  227.                 </table>
  228.               </td>
  229.             </tr>
  230.           </table>
  231.           <br>
  232.           <br>
  233.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  234.        </TD>
  235.     </TR>
  236.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  237.     </TBODY> 
  238.   </TABLE>
  239.   <BR>
  240.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  241. </form></DIV>
  242. </BODY></HTML>