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

电子政务应用

开发平台:

Java

  1. <%@ taglib uri="/vnex.tld" prefix="vnex"%>
  2. <%@ taglib uri="/vnex_addresslist.tld" prefix="addresslist"%>
  3. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  4. <%@ page import="com.vnex.intranet.util.*"%>
  5. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  6. <jsp:useBean id="groupSelect" scope="request" class="com.vnex.intranet.addresslist.handler.GroupSelectHandler" />
  7. <%
  8.      String queryStr = " where emp_id="+BusinessName.getEmpId();
  9.      String pageTo = "/mainctrl/addressbook/home?a";
  10.      String queryCondition = "";
  11.      String start = "1";
  12.      
  13.     CommonDBOperation cdb = new CommonDBOperation();
  14.     String DBProductName = cdb.getDBProduct();
  15.     if(DBProductName.startsWith("Oracle")) 
  16.     {
  17.       if(request.getParameter("search_text") != null)
  18.       {
  19.         String searchText = request.getParameter("search_text");
  20.         pageTo += "&search_text="+searchText;
  21.         queryStr += " and (name like '%"+searchText+"%') ";
  22.         if(!searchText.equals(""))
  23.         {
  24.            queryCondition = "姓名或昵称中包含有"+searchText+"字符的用户";
  25.         }
  26.       }
  27.     }
  28.     else if(DBProductName.startsWith("Microsoft SQL Server"))
  29.     {
  30.       if(request.getParameter("search_text") != null)
  31.       {
  32.         String searchText = request.getParameter("search_text");
  33.         pageTo += "&search_text="+searchText;
  34.         queryStr += " and (name like '%"+cdb.changeCode(searchText)+"%') ";
  35.         if(!searchText.equals(""))
  36.         {
  37.            queryCondition = "姓名或昵称中包含有"+searchText+"字符的用户";
  38.         }
  39.       }
  40.     }
  41.     
  42.      if(request.getParameter("contactGrp") != null)
  43.      {
  44.         String contactGrp = request.getParameter("contactGrp");
  45.         if(!contactGrp.equals("0"))
  46.         {
  47.            pageTo += "&contactGrp="+contactGrp;
  48.            queryStr += " and contact_id in (select contact_id from t_contact_x_group where group_id="+contactGrp+") ";
  49.            if( !queryCondition.equals(""))
  50.        {
  51.            queryCondition += "以及";
  52.        }
  53.        queryCondition += "属于"+contactGrp+"组别的用户";
  54.         }
  55.      }
  56.      if(request.getParameter("start") != null)
  57.         start = request.getParameter("start");
  58. %>
  59. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  60. <HTML>
  61. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  62. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  63. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
  64. <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
  65. <script language="JavaScript" src="/vnex/util/strUtil.js"></script>
  66. <script language="JavaScript">
  67. function SelectAll(form)
  68. {
  69.   for (var i=0;i<form.elements.length;i++)
  70.   {
  71.     var e = form.elements[i];
  72.     if (e.name != 'C1')
  73.        e.checked = form.C1.checked;
  74.   }
  75. }
  76. function searchByName(form)
  77. {
  78.    if(checkChar(form.search_text.value))
  79.    {
  80.       form.action = "/mainctrl/addressbook/home";
  81.       form.submit();
  82.    }
  83.    else
  84.    {
  85.       alert("请不要在查询条件中加入"<>/\'%&这样的字符");
  86.    }
  87. }
  88.  
  89. function checkChar(str)
  90. {
  91.     var i,j,strTemp;
  92.     strTemp=""<>/\'%&";
  93.     for (i=0;i<str.length;i++)
  94.     {
  95.       j=strTemp.indexOf(str.charAt(i));
  96.       if (j!=-1)
  97.       {
  98.         return false;
  99.       }
  100.     }
  101.     return true;
  102. }
  103. function deleteThem(form)
  104. {
  105.    if(form.contactIds == null)
  106.    {
  107.       alert("现在尚未有数据可供删除");
  108.       return;
  109.    }
  110.    if(!isChecked(form.contactIds))
  111.    {
  112.       alert("请选择至少一个人员再进行删除");
  113.       return;
  114.    }
  115.    if(confirm("是否要删除所选人员?"))
  116.    {
  117.       form.action="/mainctrl/addressbook/deleteContacts";
  118.       form.submit();
  119.    }   
  120. }
  121. </script>
  122. <DIV align=center>
  123. <form name="form1" method="post" action="">
  124.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  125.     <TBODY>
  126.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  127.     <TR> 
  128.         <TD colSpan=3 align="center"><br>
  129.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  130.             <tr> 
  131.               <td align="center" colspan="2" bgcolor="#FFFFFF"> 
  132.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  133.                   <tr bgcolor="#666666"> 
  134.                       <td colspan="2"><font class="strongw"><a href="/mainctrl/home/index"><font color="#ffffff">首页</font></a>&gt;&gt;<a href="/mainctrl/personal/main"><font color="#ffffff">个人办公</font></a>&gt;&gt;个人通讯录</font>
  135.                       </td>
  136.                   </tr>
  137.                 </table>  
  138.                 <table width="600" border="0" cellspacing="0" cellpadding="0">
  139.                   <tr bgcolor="#ffffff" height="30">
  140.                       <td align="left">&nbsp; 
  141.                 <strong>请选择你的用户组:</strong>
  142.                   <select name="contactGrp" size="1">
  143.                      <%=groupSelect.generateGroupCode(""+BusinessName.getEmpId())%>
  144.                   </select>&nbsp;
  145.                    <strong>查找用户姓名:</strong>&nbsp;
  146.                    <input type="text" name="search_text" size="10" class="text">&nbsp;
  147.                    <input type="button" name="button1" value="查找" class="text" onclick="searchByName(this.form)">
  148.                  </td>
  149.                   </tr>
  150.                 </table>
  151.                 <table class=title border="0" cellpadding="2" cellspacing="1" width="600">
  152.                    <tr bgcolor="#fafafa" height="30">
  153.                       <td colspan="7">&nbsp;  
  154.                           <input type="button" name="Button2" value="新增" onClick="location='/mainctrl/addressbook/createContact'" class="text">
  155.                           &nbsp;&nbsp;
  156.                           <input type="button" name="Button2" value="删除" onClick="deleteThem(this.form)" class="text">
  157.                           &nbsp;&nbsp;
  158.                           <input type="button" name="Button3" value="组管理" onclick="location='/mainctrl/addressbook/groupList'" class="text">
  159.                           &nbsp;&nbsp;
  160.                           <input type="button" name="button4" value="导入" class="text" onclick="location='/mainctrl/addressbook/import'">
  161.                           &nbsp;&nbsp;
  162.                           <input type="button" name="button5" value="导出" class="text" onclick="location='/mainctrl/addressbook/export'">
  163.                       </td>
  164.                    </tr>
  165.                    <tr> 
  166.                       <td height="12"  width="7%" align="center"><strong>选择</strong></td>
  167.                       <td height="12" align="center"><strong>姓名</strong></td>
  168.                       <td height="12" align="center"><strong>家庭电话</strong></td>
  169.                       <td height="12" align="center"><strong>EMail</strong></td>
  170.                      <td height="12" align="center"><strong>单位电话</strong></td>
  171.             <td height="12" align="center"><strong>手机</strong></td>
  172.             <td height="12" align="center"><strong>呼机</strong></td>
  173.                    </tr>
  174.                    <addresslist:addressList queryStr="<%=queryStr%>">
  175.                    <vnex:items paging="true">
  176.                    <tr bgcolor="<vnex:itemsColor />">
  177.                       <td height="12"  width="7%" align="center">
  178.                          <input type="checkbox" name="contactIds" value="<addresslist:addressAttribute attribute="contact_id" />">
  179.                       </td>
  180.                       <td height="12" align="center">
  181.                          <a href="/mainctrl/addressbook/contactDetail?contactId=<addresslist:addressAttribute attribute="contact_id" />&start=<%=start%>">
  182.                          <addresslist:addressAttribute attribute="contact_name"/></a>
  183.                       </td>
  184.                       <td height="12" align="center">
  185.                          <addresslist:addressAttribute attribute="home_tele_num"/>
  186.                       </td>
  187.                       <td height="12" align="center">
  188.                          <addresslist:addressAttribute attribute="email_address"/>
  189.                       </td>
  190.             <td height="12" align="center">
  191.                <addresslist:addressAttribute attribute="unit_tele_num"/>
  192.             </td>
  193.           <td height="12" align="center">
  194.              <addresslist:addressAttribute attribute="mobile_num"/>
  195.           </td>
  196.           <td height="12" align="center">
  197.              <addresslist:addressAttribute attribute="pager_num"/>
  198.           </td>
  199.                    </tr>   
  200.                    </vnex:items> 
  201.                    <tr bgcolor="#fafafa">
  202.                       <td width="7%" align="center"><input type="checkbox" name="C1" onclick="SelectAll(this.form)"></td>
  203.                       <td colspan="6">&nbsp;&nbsp;全选</td>
  204.                    </tr>
  205.                    <tr>
  206.                       <td colspan="7" bgcolor="#e0e0e0" align="left">&nbsp;
  207.                         <vnex:pagingTag pageName="<%=pageTo%>" />
  208.                       </td>
  209.                    </tr> 
  210.                    </addresslist:addressList>
  211.                 </table>
  212.                </td>
  213.             </tr>
  214.           </table>
  215.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  216.        </TD>
  217.      </TR>
  218.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  219.     </TBODY> 
  220.   </TABLE>
  221.     <BR>
  222.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  223. </form>
  224. </DIV>
  225. </BODY>
  226. </HTML>