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

电子政务应用

开发平台:

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. <jsp:useBean id="companyBean" class="com.vnex.intranet.commoninfo.addresslist.value.AddressListValueBean" scope="page" />
  9. <%
  10.   int companyId = 0;
  11.   if(request.getParameter("companyIds")!=null && !request.getParameter("companyIds").equals(""))
  12.     companyId = Integer.parseInt(request.getParameter("companyIds"));
  13.   companyBean = addressListProxy.getAddressListDetail(companyId);
  14. %>
  15. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  16. <HTML>
  17. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  18. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  19. <script language="javascript" src="/vnex/validate.js" ></script>
  20. <script language=JavaScript>
  21. function isDigit (c)
  22. {   
  23.   return ((c >= "0") && (c <= "9"))
  24. }
  25. function isInteger (s)
  26. {   
  27.     var i;
  28.     for (i = 0; i < s.length; i++)
  29.     {
  30.         var c = s.charAt(i);
  31.         if (!isDigit(c)) return false;
  32.     }
  33.     return true;
  34. }
  35. function isValidChar(str)
  36. {
  37.   var i,j,strTemp;
  38.   strTemp="<>/\";
  39.   for (i=0;i<str.length;i++)
  40.   {
  41.     j=strTemp.indexOf(str.charAt(i));
  42.     if (j!=-1)
  43.     {
  44.       return false;
  45.     }
  46.   }
  47.   return true;
  48. }
  49. function check()
  50. {
  51.   if (!stripWhitespace(document.myform.companyName.value) || document.myform.companyName.value=="" || document.myform.companyName.value.length>50)
  52. {
  53.   alert("公司名不能为空,并且少于50个字。");
  54.   document.myform.companyName.focus();
  55.   return false;
  56. }
  57. if (document.myform.companyAddress.value.length>50)
  58. {
  59.   alert("公司地址应少于50个字。");
  60.   document.myform.companyAddress.focus();
  61.   return false;
  62. }
  63. if ((!document.myform.companyZip.value=="" && document.myform.companyZip.value.length!=6) || !isInteger(document.myform.companyZip.value))
  64. {
  65.   alert("公司邮编应该是6位数字。");
  66.   document.myform.companyZip.focus();
  67.   return false;
  68. }
  69. if (document.myform.companyTelephone.value.length>20)
  70. {
  71.   alert("公司电话应少于20个字。");
  72.   document.myform.companyTelephone.focus();
  73.   return false;
  74. }
  75. if (document.myform.companyFax.value.length>20)
  76. {
  77.   alert("公司传真应少于20个字。");
  78.   document.myform.companyFax.focus();
  79.   return false;
  80. }
  81.   if(!isValidChar(myform.companyName.value) || !isValidChar(myform.companyAddress.value) || !isValidChar(myform.companyTelephone.value) 
  82.      || !isValidChar(myform.companyFax.value))
  83.   {
  84.     alert("输入内容不能包括 < > / \ 这些特殊字符。");
  85.     return false;
  86.   }
  87.   else
  88.     return true;
  89. }
  90. function modifyCompany()
  91. {
  92.  if( !check() )
  93.  {
  94.    return false;
  95.  }
  96.  myform.action= "/mainctrl/commoninfo/addresslist/modifyAddressListSuccess";
  97.   myform.submit();
  98. }
  99. </script>
  100. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  101. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  102. <DIV align=center>
  103.   <form name="myform" method="post" action="">
  104.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  105.     <TBODY> 
  106.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  107.     <TR> 
  108.         <TD colSpan=3 align="center"><br>
  109.           <!--个人信息开始 -->
  110.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  111.             <tr bgcolor="#fafafa">
  112.               <td>
  113.                 <table width="600" border="0" cellspacing="1" cellpadding="2" class="title">
  114.                   <tr bgcolor="#666666"> 
  115.                     <td colspan="2"><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>
  116.                   </tr>
  117.                   <tr bgcolor="#e0e0e0"> 
  118.                     <td width="17%">
  119.                       <font class="strong">&nbsp;公司名称:</font>
  120.                     </td>
  121.                     <td width="83%"> 
  122.                       <input type="text" name="companyName" class="file" value="<%= FieldUtil.filterQuotTag(companyBean.getCompanyName())%>" size="24">&nbsp;*&nbsp;(注:带*为必填内容)
  123.                     </td>
  124.                   </tr>
  125.                   <tr bgcolor="#fafafa"> 
  126.                     <td> 
  127.                       <font class="strong">&nbsp;地址:</font>
  128.                     </td>
  129.                     <td>
  130.                       <input type="text" name="companyAddress" class="file" value="<%= FieldUtil.filterQuotTag(companyBean.getCompanyAddress())%>" size="72">
  131.                     </td>
  132.                   </tr>
  133.                   <tr bgcolor="#e0e0e0"> 
  134.                     <td> 
  135.                       <font class="strong">&nbsp;邮编:</font>
  136.                     </td>
  137.                     <td>
  138.                       <input type="text" name="companyZip" class="file" value="<% if(companyBean.getCompanyZip()!=0) out.println(companyBean.getCompanyZip()); %>" size="6">
  139.                     </td>
  140.                   </tr>
  141.                   <tr bgcolor="#fafafa"> 
  142.                     <td> 
  143.                       <font class="strong">&nbsp;电话:</font>
  144.                     </td>
  145.                     <td>
  146.                       <input type="text" name="companyTelephone" class="file" value="<%= FieldUtil.filterQuotTag(companyBean.getCompanyTelephone())%>" size="24">
  147.                     </td>
  148.                   </tr>
  149.                   <tr bgcolor="#e0e0e0"> 
  150.                     <td> 
  151.                       <font class="strong">&nbsp;传真:</font>
  152.                     </td>
  153.                     <td> 
  154.                       <input type="text" name="companyFax" class="file" value="<%= FieldUtil.filterQuotTag(companyBean.getCompanyFax())%>" size="24">
  155.                     </td>
  156.                   </tr>
  157.                   <tr bgcolor="#fafafa"> 
  158.                     <td colspan="2" height="30"> 
  159.                       <div align="center"> 
  160.                         <input type="button" name="Submit" value="保存" class="text" onClick="return modifyCompany()">
  161.                         &nbsp;&nbsp;<input type="reset" name="Submit3" value="重置" class="text">
  162.                         &nbsp;&nbsp;<input type="button" name="Submit2" value="放弃" class="text" onClick="history.back()">
  163.                       </div>
  164.                     <input type="hidden" name="companyId" value="<%= companyId%>">
  165. <%
  166.   if(request.getParameter("start")!=null)
  167.   {
  168.     out.println("<input type="hidden" name="start" value=""+request.getParameter("start")+"">");
  169.   }
  170. %>
  171.                     </td>
  172.                   </tr>
  173.                 </table>
  174.               </td>
  175.             </tr>
  176.           </table>
  177.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  178.        </TD>
  179.     </TR>
  180.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  181.     </TBODY> 
  182.   </TABLE>
  183.   <BR>
  184.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  185. </form></DIV>
  186. </BODY></HTML>