index.jsp
<?xml version="1.0" encoding='utf-8'?>
<%@ page contentType="text/vnd.wap.wml;charset=UTF-8"%>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<%@ page import="java.sql.Connection"%>
<%@ page import="java.sql.ResultSet"%>
<%@ page import="java.sql.Statement"%>
<%@ page import="com.telecom.dao.DBLinker"%>
<%@ page import="com.telecom.dao.linkman.DepSupport"%>
<%@ page import="com.telecom.common.form.DepForm"%>
<%@ page import="com.telecom.common.form.UserForm"%>
<%@ page import="java.util.ArrayList"%>
<wml>
<card id="main" title="企信机联系人" newcontext="true">
<p>
<%
java.util.Enumeration emu = request.getHeaderNames();
String e = new String();
String s = new String();
String mobile = new String();
int i = 0;
while (emu.hasMoreElements()) {
i++;
e = (String) emu.nextElement();
if (e.equals("x-up-calling-line-id")) {
mobile = request.getHeader(e);
}
System.out.println(i + e);
s = request.getHeader(e);
System.out.println(s);
}
//DepSupport ds=new DepSupport();
Connection conn = (Connection) DBLinker.linkDB();
String sql = "select * from tbDepartment where intParentID=0 and intType=1 and intEnable=1";
ResultSet rs = null;
Statement sta = conn.createStatement();
rs = sta.executeQuery(sql);
while (rs.next()) {
String dep_name = rs.getString("strName");
int dep_id = rs.getInt("intID");
%>
<%=dep_name%>
<br />
<%
String sql2 = "select a.intID userID,b.intID memberID,a.strName uname,b.intDepID depID from tbUser a,tbUserDep b where a.intEnable=1 and a.intOpen=1 and b.intEnable=1 and a.intID=b.intUserID ";
System.out.println(sql2);
ResultSet rs2 = null;
Statement sta2 = conn.createStatement();
rs2 = sta2.executeQuery(sql2);
while (rs2.next()) {
String addrName = rs2.getString("uname");
int addrID = rs2.getInt("userID");
int depnum = rs2.getInt("depID");
int dep_id2 = new DepSupport().GetTopID(conn, depnum);
if (dep_id2 == dep_id) {
%>
<img alt=":)" src="../img/bullet.gif" />
<anchor>
<%=addrName%>
<go href="eim.jsp" accept-charset="UTF-8">
<postfield name="getter" value="<%=addrName%>"/>
<postfield name="getterID" value="<%=addrID%>"/>
<postfield name="type" value="企业用户"/>
<postfield name="mobile" value="<%=mobile%>"/>
</go>
</anchor>
<br />
<%
}
}
%>
<br />
<%
}
%>
<%
String sql3 = "select * from tbAddressType where intEnable=1 and intUserID=1";
Statement sta3 = conn.createStatement();
ResultSet rs3 = sta3.executeQuery(sql3);
;
while (rs3.next()) {
String gName = rs3.getString("strName");
int gID = rs3.getInt("intID");
%>
<%=gName%>
<br />
<%
String sql4 = " select strName ,intID from tbUser where intID in(select intUserID from tbAddressMember where intEnable=1 and intType=1 and intAddressTypeID= "
+ gID + ")";
Statement sta4 = conn.createStatement();
ResultSet rs4 = sta4.executeQuery(sql4);
;
while (rs4.next()) {
String iName = rs4.getString("strName");
int iID=rs4.getInt("intID");
%>
<img alt=":)" src="../img/bullet.gif" />
<anchor>
<%=iName%>
<go href="eim.jsp" >
<postfield name="getter" value="<%=iName%>"/>
<postfield name="getterID" value="<%=iID%>"/>
<postfield name="type" value="企业用户"/>
<postfield name="mobile" value="<%=mobile%>"/>
</go>
</anchor>
<br />
<%
}
String sql5 = " select strName,intID from tbExtraPerson where intID in(select intUserID from tbAddressMember where intEnable=1 and intType=2 and intAddressTypeID= "
+ gID + ")";
Statement sta5 = conn.createStatement();
ResultSet rs5 = sta5.executeQuery(sql5);
;
while (rs5.next()) {
String oName = rs5.getString("strName");
int oID=rs5.getInt("intID");
%>
<img alt=":)" src="../img/bullet.gif" />
<anchor>
<%=oName%>
<go href="eim.jsp" >
<postfield name="getter" value="<%=oName%>"/>
<postfield name="getterID" value="<%=oID%>"/>
<postfield name="type" value="非企业用户"/>
<postfield name="mobile" value="<%=mobile%>"/>
</go>
</anchor>
<br />
<%
}
%>
<br />
<%
}
%>
</p>
</card>
</wml>
2. EIM.jsp
<?xml version="1.0" ?>
<%@ page contentType="text/vnd.wap.wml;charset=UTF-8"%>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<%
String getter = new String( request.getParameter("getter").getBytes("iso8859-1"),"UTF-8");
int getterID = Integer.parseInt(request.getParameter("getterID"));
String type = request.getParameter("type");
type=new String( type.getBytes("iso8859-1"),"UTF-8");
String mobile=request.getParameter("mobile");
%>
<wml>
<card id="main" title="WAP业务" newcontext="true">
<p mode="nowrap">
发送对象:
<%=getter%>
<br />
<br />
类型:
<%=type%>
<br />
<br />
信息内容:
<input name="content" type="text" maxlength="70"
size="32" />
<br />
<br />
<anchor>
发送短信
<go href="downSMS.jsp" >
<postfield name="content" value="$(content)" />
<postfield name="getterID" value="<%=getterID%>" />
<postfield name="type" value="<%=type%>" />
</go>
</anchor>
<anchor>
<br />
<br />
呼叫对方
<go href="downVoice.jsp" >
<postfield name="getterID" value="<%=getterID%>" />
<postfield name="type" value="<%=type%>" />
<postfield name="sender" value="<%=mobile%>" />
</go>
</anchor>
</p>
</card>
</wml>