Address_View.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:15k
源码类别:
电子政务应用
开发平台:
Java
- <%@ page errorPage="/vnex/ErrorPage.jsp" %>
- <%@ page import="com.vnex.intranet.commoninfo.addresslist.value.*"%>
- <%@ page import="com.vnex.intranet.commoninfo.addresslist.proxy.*"%>
- <%@ page import="com.vnex.intranet.util.*"%>
- <%@ page import="java.util.*" %>
- <%@ page import="java.sql.*" %>
- <jsp:useBean id="addressListProxy" class="com.vnex.intranet.commoninfo.addresslist.proxy.AddressListProxyBean" scope="application" />
- <%
- int companyId = 0;
- if(request.getParameter("companyId")!=null && !request.getParameter("companyId").equals(""))
- companyId = Integer.parseInt(request.getParameter("companyId"));
- String con = "";
- String sDepartment = "";
- String sEmployeName = "";
- CommonDBOperation cdb = new CommonDBOperation();
- String DBProductName = cdb.getDBProduct();
- if(DBProductName.startsWith("Oracle"))
- {
- if(request.getParameter("back")!=null && request.getParameter("back").equals("ok"))
- {
- if(request.getParameter("ssDepartment")!=null && !request.getParameter("ssDepartment").equals(""))
- {
- sDepartment = request.getParameter("ssDepartment");
- con = " and employe_department='"+sDepartment+"'";
- }
- if(request.getParameter("ssEmployeName")!=null && !request.getParameter("ssEmployeName").equals(""))
- {
- sEmployeName = request.getParameter("ssEmployeName");
- con = con + " and employe_name like '%"+sEmployeName+"%'";
- }
- }
- if(request.getParameter("sDepartment")!=null && !request.getParameter("sDepartment").equals(""))
- {
- sDepartment = request.getParameter("sDepartment");
- con = " and employe_department='"+sDepartment+"'";
- }
- if(request.getParameter("sEmployeName")!=null && !request.getParameter("sEmployeName").equals(""))
- {
- sEmployeName = request.getParameter("sEmployeName");
- con = con + " and employe_name like '%"+sEmployeName+"%'";
- }
- }
- else if(DBProductName.startsWith("Microsoft SQL Server"))
- {
- if(request.getParameter("back")!=null && request.getParameter("back").equals("ok"))
- {
- if(request.getParameter("ssDepartment")!=null && !request.getParameter("ssDepartment").equals(""))
- {
- sDepartment = request.getParameter("ssDepartment");
- con = " and employe_department='"+cdb.changeCode(sDepartment)+"'";
- }
- if(request.getParameter("ssEmployeName")!=null && !request.getParameter("ssEmployeName").equals(""))
- {
- sEmployeName = request.getParameter("ssEmployeName");
- con = con + " and employe_name like '%"+cdb.changeCode(sEmployeName)+"%'";
- }
- }
- if(request.getParameter("sDepartment")!=null && !request.getParameter("sDepartment").equals(""))
- {
- sDepartment = request.getParameter("sDepartment");
- con = " and employe_department='"+cdb.changeCode(sDepartment)+"'";
- }
- if(request.getParameter("sEmployeName")!=null && !request.getParameter("sEmployeName").equals(""))
- {
- sEmployeName = request.getParameter("sEmployeName");
- con = con + " and employe_name like '%"+cdb.changeCode(sEmployeName)+"%'";
- }
- }
- AddressListValueBean companyBeanD = new AddressListValueBean();
- AddressListValueBean companyBean = new AddressListValueBean();
- companyBeanD = addressListProxy.getAddressListDetail(companyId);
- companyBean = addressListProxy.getAddressListDetail(companyId, con);
- session.setAttribute("companyBean", companyBean);
- if(request.getParameter("sstart")!=null)
- {
- session.setAttribute("start", request.getParameter("sstart"));
- }
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <script language="javascript" src="/vnex/validate.js" ></script>
- <script language=JavaScript>
- function isValidChar(str)
- {
- var i,j,strTemp;
- strTemp=""'<>/\";
- for (i=0;i<str.length;i++)
- {
- j=strTemp.indexOf(str.charAt(i));
- if (j!=-1)
- {
- return false;
- }
- }
- return true;
- }
- function linkEmploye(employeId)
- {
- document.myform.action = "/mainctrl/commoninfo/addresslist/modifyAddressEmploye?employeIds="+employeId;
- document.myform.submit();
- }
- function removeCompanys()
- {
- myform.action= "/mainctrl/commoninfo/addresslist/removeAddressListSuccess";
- myform.submit();
- }
- function modifyCompany()
- {
- myform.action= "/mainctrl/commoninfo/addresslist/modifyAddressList";
- myform.submit();
- }
- function removeEmployes()
- {
- if(document.myform.employeIds==null)
- {
- alert("没有要删除的职工。");
- return false;
- }
- if( !isChecked(document.myform.employeIds) )
- {
- alert("请选择要删除的职工。");
- return false;
- }
- if(!confirm("是否确定删除?"))
- {
- return false;
- }
- myform.action= "/mainctrl/commoninfo/addresslist/removeAddressEmployeSuccess";
- myform.submit();
- }
- function searchEmploye()
- {
- if(!isValidChar(myform.sEmployeName.value))
- {
- alert("查询职员姓名不能包括 " ' < > / \ 这些特殊字符。");
- myform.sEmployeName.focus();
- return false;
- }
- myform.action= "/mainctrl/commoninfo/addresslist/detailAddressList?start=1";
- myform.submit();
- }
- function CheckAll(form)
- {
- for (var i=0;i<form.elements.length;i++)
- {
- var e = form.elements[i];
- if (e.name != 'chkall')
- e.checked = form.chkall.checked;
- }
- }
- </script>
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
- <DIV align=center>
- <form name="myform" method="post" action="">
- <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
- <TBODY>
- <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
- <TR>
- <TD colSpan=3 align="center">
- <!--个人信息开始 --><br>
- <table width="600" border="1" cellspacing="1" bordercolor="#666666">
- <tr>
- <td>
- <table width="600" border="0" cellspacing="0" cellpadding="2">
- <tr bgcolor="#666666">
- <td colspan="4" height="15"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>><a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>>><a href="/mainctrl/commoninfo/addresslist/getAddressList"><font color="#FFFFFF">外部通讯录</font></a>>>显示通讯录详细信息</font></td>
- </tr>
- </table>
- <table border="0" cellpadding="0" cellspacing="0" width="600" class=title>
- <tr bgcolor="#e0e0e0" align="center">
- <td>
- <table border="0" cellpadding="0" cellspacing="1" width="100%" class=title>
- <tr bgcolor="#e0e0e0">
- <td width="17%"><font class="strong"> 公司名称:</font></td>
- <td width="83%" colspan="5"><%= companyBean.getCompanyName()%></td>
- </tr>
- <tr bgcolor="#fafafa">
- <td width="17%"><font class="strong"> 地址:</font></td>
- <td width="83%" colspan="5"><%= companyBean.getCompanyAddress()%></td>
- </tr>
- <tr bgcolor="#e0e0e0">
- <td width="17%"><font class="strong"> 邮编:</font></td>
- <td width="16%"><% if(companyBean.getCompanyZip()!=0) out.println(companyBean.getCompanyZip()); %></td>
- <td width="17%"><font class="strong"> 电话:</font></td>
- <td width="16%"><%= companyBean.getCompanyTelephone()%></td>
- <td width="17%"><font class="strong"> 传真:</font></td>
- <td width="16%"><%= companyBean.getCompanyFax()%></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table width="100%" border="0" cellspacing="1" cellpadding="2" class=title>
- <tr bgcolor="#fafafa">
- <td height="30" colspan="9">
- <font class="strong">选择部门:</font>
- <select name="sDepartment" style="width=100">
- <option value="">全部</option>
- <%
- Collection col = companyBeanD.getEmployes();
- AddressEmployeValueBean evb = null;
- Vector vec = new Vector();
- if(col != null && col.size() != 0)
- {
- Iterator it = col.iterator();
- while( it.hasNext() )
- {
- evb = (AddressEmployeValueBean)it.next();
- if( !vec.contains(evb.getEmployeDepartment()) )
- {
- vec.add(evb.getEmployeDepartment());
- }
- }
- }
- for(int i=0; i<vec.size(); i++)
- {
- if( vec.get(i)!=null )
- {
- if(sDepartment.equals( (String)vec.get(i) ))
- {
- out.println("<option value=""+FieldUtil.filterQuotTag((String)vec.get(i))+"" selected>" + (String)vec.get(i) + "</option>");
- }
- else
- {
- out.println("<option value=""+FieldUtil.filterQuotTag((String)vec.get(i))+"">" + (String)vec.get(i) + "</option>");
- }
- }
- }
- %>
- </select>
- <font class="strong" >职员姓名:</font>
- <input type="text" name="sEmployeName" class="file" value="<%= sEmployeName%>">
- <input type="button" name="Button" value="查询" class="text" onClick="return searchEmploye()">
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td colspan="9" height="30">
- <input type="button" name="Button2" value="新增员工" class="text" onClick="location='/mainctrl/commoninfo/addresslist/createAddressEmploye?companyId=<%= companyId%>'" style="width:60px">
- <input type="button" name="Button3" value="删除员工" class="text" onClick="return removeEmployes()" style="width:60px">
- <input type="button" name="Button522" value="返回" class="file" onClick="location='/mainctrl/commoninfo/addresslist/getAddressList?start=<%= (String)session.getAttribute("start")%>'">
- </td>
- </tr>
- <tr align="center">
- <td width="7%"><font class="strong">选择</font></td>
- <td width="10%"><font class="strong">姓名</font></td>
- <td width="9%"><font class="strong">部门</font></td>
- <td width="9%"><font class="strong">职务</font></td>
- <td width="9%"><font class="strong">分机</font></td>
- <td width="9%"><font class="strong">呼机</font></td>
- <td width="9%"><font class="strong">手机</font></td>
- <td width="12%"><font class="strong">办公室</font></td>
- <td width="26%"><font class="strong">Email</font></td>
- </tr>
- <%
- Collection coll = companyBean.getEmployes();
- AddressEmployeValueBean aevb = null;
- int start = 1;
- if ( request.getParameter("start") !=null )
- {
- start = Integer.parseInt( request.getParameter("start") );
- }
- int rowPerPage = com.vnex.intranet.system.loader.ConfigParaLoader.getParameterByInt("rowNum");
- int size = coll.size();
- String action = "/mainctrl/commoninfo/addresslist/detailAddressList?companyId=" + companyId;
- if(!sDepartment.equals(""))
- {
- action += "&sDepartment=" + sDepartment;
- }
- if(!sEmployeName.equals(""))
- {
- action += "&sEmployeName=" + sEmployeName;
- }
- String nav = NavBar.makeNavbar(start, size, rowPerPage, action);
- int i = 0;
- if(coll != null && coll.size() != 0)
- {
- Iterator it = coll.iterator();
- int flag = 0;
- String bgcolor = null;
- while( it.hasNext() && i < size && i < ( start+rowPerPage-1) )
- {
- i++;
- aevb = (AddressEmployeValueBean)it.next();
- if ( i < start ) continue;
- if( flag%2==0 )
- {
- bgcolor = "#e0e0e0";
- }
- else
- {
- bgcolor = "#fafafa";
- }
- %>
- <tr bgcolor="<%= bgcolor%>" align="center">
- <td>
- <input type="checkbox" name="employeIds" value="<%= aevb.getEmployeId()%>">
- </td>
- <td><a href="JavaScript:linkEmploye(<%= aevb.getEmployeId()%>)"><%= aevb.getEmployeName()%></a></td>
- <td><%= aevb.getEmployeDepartment()%></td>
- <td><%= aevb.getEmployeDuty()%></td>
- <td><% if(aevb.getEmployeExtension()!=0) out.println(aevb.getEmployeExtension()); %></td>
- <td><%= aevb.getEmployePager()%></td>
- <td><%= aevb.getEmployeHandset()%></td>
- <td><%= aevb.getEmployeOffice()%></td>
- <td><a href="mailto:<%= aevb.getEmployeEmail()%>"><%= aevb.getEmployeEmail()%></a></td>
- </tr>
- <%
- flag++;
- }
- }
- %>
- <%
- if(size!=0)
- {
- %>
- <tr bgcolor="#fafafa">
- <td align="center">
- <input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)">
- </td>
- <td colspan="8">
- 全选
- </td>
- </tr>
- <%
- }
- %>
- <tr bgcolor="#e0e0e0">
- <td colspan="9">
- <%= nav %>
- </td>
- <input type="hidden" name="companyId" value="<%= companyId%>">
- <input type="hidden" name="companyIds" value="<%= companyId%>">
- <%
- out.println("<input type=hidden name=ssDepartment value=""+sDepartment+"">");
- out.println("<input type=hidden name=ssEmployeName value=""+sEmployeName+"">");
- out.println("<input type=hidden name=start value=""+start+"">");
- %>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <br>
- <br>
- <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
- </TD>
- </TR>
- <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
- </TBODY>
- </TABLE>
- <BR>
- <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
- </form></DIV>
- </BODY></HTML>