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

电子政务应用

开发平台:

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 companyId = 0;
  10.   if(request.getParameter("companyId")!=null && !request.getParameter("companyId").equals(""))
  11.     companyId = Integer.parseInt(request.getParameter("companyId"));
  12.   
  13.   String con = "";
  14.   String sDepartment = "";
  15.   String sEmployeName = "";
  16.   
  17.     CommonDBOperation cdb = new CommonDBOperation();
  18.     String DBProductName = cdb.getDBProduct();
  19.     if(DBProductName.startsWith("Oracle")) 
  20.     {
  21.       if(request.getParameter("sDepartment")!=null && !request.getParameter("sDepartment").equals(""))
  22.       {
  23.         sDepartment = request.getParameter("sDepartment");
  24.         con = " and employe_department='"+sDepartment+"'";
  25.       }
  26.       if(request.getParameter("sEmployeName")!=null && !request.getParameter("sEmployeName").equals(""))
  27.       {
  28.         sEmployeName = request.getParameter("sEmployeName");
  29.         con = con + " and employe_name like '%"+sEmployeName+"%'";
  30.       }
  31.     }
  32.     else if(DBProductName.startsWith("Microsoft SQL Server"))
  33.     {
  34.       if(request.getParameter("sDepartment")!=null && !request.getParameter("sDepartment").equals(""))
  35.       {
  36.         sDepartment = request.getParameter("sDepartment");
  37.         con = " and employe_department='"+cdb.changeCode(sDepartment)+"'";
  38.       }
  39.       if(request.getParameter("sEmployeName")!=null && !request.getParameter("sEmployeName").equals(""))
  40.       {
  41.         sEmployeName = request.getParameter("sEmployeName");
  42.         con = con + " and employe_name like '%"+cdb.changeCode(sEmployeName)+"%'";
  43.       }
  44.     }
  45.   
  46.   
  47.   AddressListValueBean companyBeanD = new AddressListValueBean();
  48.   AddressListValueBean companyBean = new AddressListValueBean();
  49.   companyBeanD = addressListProxy.getAddressListDetail(companyId);
  50.   companyBean = addressListProxy.getAddressListDetail(companyId, con);
  51. %>
  52. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  53. <HTML>
  54. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  55. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  56. <script language=JavaScript>
  57. function isValidChar(str)
  58. {
  59.   var i,j,strTemp;
  60.   strTemp=""'<>/\";
  61.   for (i=0;i<str.length;i++)
  62.   {
  63.     j=strTemp.indexOf(str.charAt(i));
  64.     if (j!=-1)
  65.     {
  66.       return false;
  67.     }
  68.   }
  69.   return true;
  70. }
  71. function searchEmploye()
  72. {
  73.   if(!isValidChar(myform.sEmployeName.value))
  74.   {
  75.     alert("查询职员姓名不能包括 " ' < > / \ 这些特殊字符。");
  76.     myform.sEmployeName.focus();
  77.     return false;
  78.   }
  79.  myform.action= "/mainctrl/commoninfo/addresslist/detailAddressListClient";
  80.   myform.submit();
  81. }
  82. </script>
  83. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_public.js"></script>
  84. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  85. <DIV align=center>
  86. <form name="myform" method="post" action="">
  87.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  88.     <TBODY> 
  89.       <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  90.     <TR> 
  91.         <TD colSpan=3 align="center">
  92.           <br>
  93.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  94.             <tr> 
  95.               <td>
  96.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  97.                   <tr bgcolor="#666666"> 
  98.                     <td height="15"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/public/main"><font color="#FFFFFF">公用信息</font></a>&gt;&gt;<a href="/mainctrl/commoninfo/addresslist/getAddressListClient"><font color="#FFFFFF">外部通讯录</font></a>&gt;&gt;显示通讯录详细信息</font></td>
  99.                   </tr>
  100.                 </table>
  101.                 <table border="0" cellpadding="0" cellspacing="1" width="600" class=title>
  102.                   <tr bgcolor="#e0e0e0"> 
  103.                     <td width="17%"><font class="strong">&nbsp;&nbsp;公司名称:</font></td>
  104.                     <td width="83%" colspan="5"><%= companyBean.getCompanyName()%></td>
  105.                   </tr>
  106.                   <tr bgcolor="#fafafa"> 
  107.                     <td width="17%"><font class="strong">&nbsp;&nbsp;地址:</font></td>
  108.                     <td width="83%" colspan="5"><%= companyBean.getCompanyAddress()%></td>
  109.                   </tr>
  110.                   <tr bgcolor="#e0e0e0"> 
  111.                     <td width="17%"><font class="strong">&nbsp;&nbsp;邮编:</font></td>
  112.                     <td width="16%">
  113.                       <% if(companyBean.getCompanyZip()!=0) out.println(companyBean.getCompanyZip()); %>
  114.                     </td>
  115.                     <td width="17%"><font class="strong">&nbsp;&nbsp;电话:</font></td>
  116.                     <td width="16%"><%= companyBean.getCompanyTelephone()%></td>
  117.                     <td width="17%"><font class="strong">&nbsp;&nbsp;传真:</font></td>
  118.                     <td width="16%"><%= companyBean.getCompanyFax()%></td>
  119.                   </tr>
  120.                 </table>
  121.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  122.                   <tr bgcolor="#fafafa"> 
  123.                     <td height="30" colspan="9"> &nbsp;<font class="strong">选择部门:</font> 
  124.                       <select name="sDepartment" style="width=100">
  125.                         <option value="">全部</option>
  126. <%
  127.   Collection col = companyBeanD.getEmployes();
  128.   AddressEmployeValueBean evb = null;
  129.   Vector vec = new Vector();
  130.   if(col != null && col.size() != 0)
  131.   {
  132.   Iterator it = col.iterator();
  133.   while( it.hasNext() )
  134.   {
  135.       evb = (AddressEmployeValueBean)it.next();
  136.       if( !vec.contains(evb.getEmployeDepartment()) )
  137.       {
  138.         vec.add(evb.getEmployeDepartment());
  139.       }
  140.     }
  141.   }
  142.   for(int i=0; i<vec.size(); i++)
  143.   {
  144.     if( vec.get(i)!=null )
  145.     {
  146.       if(sDepartment.equals( (String)vec.get(i) ))
  147.       {
  148.         out.println("<option value=""+FieldUtil.filterQuotTag((String)vec.get(i))+"" selected>" + (String)vec.get(i) + "</option>");
  149.       }
  150.       else
  151.       {
  152.         out.println("<option value=""+FieldUtil.filterQuotTag((String)vec.get(i))+"">" + (String)vec.get(i) + "</option>");
  153.       }
  154.     }
  155.   }
  156. %>
  157.                       </select>
  158.                       &nbsp;<font class="strong">职员姓名:</font> 
  159.                       <input type="text" name="sEmployeName" class="file" value="<%= sEmployeName%>">
  160.                       &nbsp; 
  161.                       <input type="button" name="Button2" value="查询" class="text" onClick="return searchEmploye()">
  162.                     </td>
  163.                   </tr>
  164.                 </table>
  165.                 <table width="600" border="0" cellpadding="2" cellspacing="1" class=title>
  166.                   <tr align="center"> 
  167.                     <td><font class="strong">姓名</font></td>
  168.                     <td><font class="strong">部门</font></td>
  169.                     <td><font class="strong">职务</font></td>
  170.                     <td><font class="strong">分机</font></td>
  171.                     <td><font class="strong">呼机</font></td>
  172.                     <td><font class="strong">手机</font></td>
  173.                     <td><font class="strong">办公室</font></td>
  174.                     <td><font class="strong">Email</font></td>
  175.                   </tr>
  176.                   <%
  177.   Collection coll = companyBean.getEmployes();
  178.   AddressEmployeValueBean aevb = null;
  179.   
  180.   int start = 1;
  181.   if ( request.getParameter("start") !=null )
  182.   {
  183.     start = Integer.parseInt( request.getParameter("start") );
  184.   }
  185.   int rowPerPage = com.vnex.intranet.system.loader.ConfigParaLoader.getParameterByInt("rowNum");
  186.   int size = coll.size();
  187.   String action = "/mainctrl/commoninfo/addresslist/detailAddressListClient?companyId=" + companyId;
  188.   if(!sDepartment.equals(""))
  189.   {
  190.     action += "&sDepartment=" + sDepartment;
  191.   }
  192.   if(!sEmployeName.equals(""))
  193.   {
  194.     action += "&sEmployeName=" + sEmployeName;
  195.   }
  196.   String nav = NavBar.makeNavbar(start, size, rowPerPage, action);
  197.   int i = 0;
  198.      if(coll != null && coll.size() != 0)
  199.      {
  200.        Iterator it = coll.iterator();
  201.        int flag = 0;
  202.        String bgcolor = null;
  203.        while( it.hasNext() && i < size && i < ( start+rowPerPage-1) )
  204.        {
  205.            i++;
  206.            aevb = (AddressEmployeValueBean)it.next();
  207.            if ( i < start ) continue;
  208.            if( flag%2==0 )
  209.            {
  210.              bgcolor = "#e0e0e0";
  211.            }
  212.            else
  213.            {
  214.              bgcolor = "#fafafa";
  215.            }
  216.            
  217. %>
  218.                   <tr bgcolor="<%= bgcolor%>" align="center"> 
  219.                     <td><%= aevb.getEmployeName()%></td>
  220.                     <td><%= aevb.getEmployeDepartment()%></td>
  221.                     <td><%= aevb.getEmployeDuty()%></td>
  222.                     <td>
  223.                       <% if(aevb.getEmployeExtension()!=0) out.println(aevb.getEmployeExtension()); %>
  224.                     </td>
  225.                     <td><%= aevb.getEmployePager()%></td>
  226.                     <td><%= aevb.getEmployeHandset()%></td>
  227.                     <td><%= aevb.getEmployeOffice()%></td>
  228.                     <td><a href="mailto:<%= aevb.getEmployeEmail()%>"><%= aevb.getEmployeEmail()%></a></td>
  229.                   </tr>
  230. <%
  231.            flag++;
  232.          }
  233.        }
  234.   if(request.getParameter("sstart")!=null)
  235.   {
  236.     session.setAttribute("start", request.getParameter("sstart"));
  237.   }
  238. %>
  239.                   <input type="hidden" name="companyId" value="<%= companyId%>">
  240.                   <tr> 
  241.                     <td bgcolor="#e0e0e0" colspan="8"> &nbsp;<%= nav %> </td>
  242.                   </tr>
  243.                   <tr bgcolor="#fafafa" align="center"> 
  244.                     <td colspan="8" height="30"> 
  245.                       <input type="button" value="返回" name="B1" onClick="location='/mainctrl/commoninfo/addresslist/getAddressListClient?start=<%= (String)session.getAttribute("start")%>'" class="text">
  246.                     </td>
  247.                   </tr>
  248.                 </table>
  249.               </td>
  250.             </tr>
  251.           </table>
  252.           <br>
  253.           <br>
  254.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  255.       </TD>
  256.     </TR>
  257.     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  258.     </TBODY> 
  259.   </TABLE>
  260.     <BR>
  261.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  262. </form></DIV>
  263. </BODY></HTML>