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

电子政务应用

开发平台:

Java

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