⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add_called_num.jsp

📁 这个是本人刚刚开发的一个WAP 网站源码
💻 JSP
字号:
<%@ page contentType="text/vnd.wap.wml; charset=UTF-8"  %>
<%@ page import="com.wap.common.db.DBObject"%>
<%
request.setCharacterEncoding("UTF-8");
//获取登陆成功的用户序列ID
String idStr = request.getParameter("id");

int id = 0; //用户的数据库序列ID
if(idStr == null || idStr.equals("")){
	response.sendRedirect("index.jsp"); //返回首页重新登陆
}else{
	long key = 0;
	try{
		key = Long.parseLong(idStr);
	}catch(Exception ex){
		ex.printStackTrace();
	}
	
	if(key <= 0){ //用户序列ID出错
		response.sendRedirect("index.jsp"); //返回首页重新登陆
	}else{
		//解密(每小时密钥就会更新一次)
		long private_key = (new java.util.Date()).getTime()/(1000*60*60*24); 
		 
		id = (int)(key -private_key);
	}
	
	
}


//步骤1:根据用户序列ID(解密过的ID),获取当前用户的通讯记录集合
//该步骤不能少,紧防恶意登陆
java.util.ArrayList list = null;
if(id > 0){ //解密成功
	try{
		DBObject db = new DBObject();
		String sql = "select name,tel1,tel2 from addresslist_manycall where isfolder = 0  and  manycall_user_id = " + id ;
		list = (java.util.ArrayList)db.executeQueryAndRetrieveList(sql);
	}catch(Exception ex){ex.printStackTrace();}
	if(list == null || list.size() == 0){
		//response.sendRedirect("index.jsp"); //出现脏数据,返回首页重新登陆
		list = new java.util.ArrayList();
	}
}else{ //解密失败
	response.sendRedirect("index.jsp"); //返回首页重新登陆
}

String call_from = request.getParameter("call_from");//主叫方
String call_to1 = request.getParameter("call_to1");
String call_to2 = request.getParameter("call_to2");
String call_to3 = request.getParameter("call_to3");
String call_to4 = request.getParameter("call_to4");
String call_to5 = request.getParameter("call_to5");
String call_to6 = request.getParameter("call_to6");
String call_to7 = request.getParameter("call_to7"); 

call_to1 = call_to1==null? "" : call_to1.trim();
call_to2 = call_to2==null? "" : call_to2.trim();
call_to3 = call_to3==null? "" : call_to3.trim();
call_to4 = call_to4==null? "" : call_to4.trim();
call_to5 = call_to5==null? "" : call_to5.trim();
call_to6 = call_to6==null? "" : call_to6.trim();
call_to7 = call_to7==null? "" : call_to7.trim();


 //System.out.println("------******---"); 
			// System.out.println("call1:"+call_to1);
			// System.out.println("call2:"+call_to2);
			// System.out.println("call3:"+call_to3);
			// System.out.println("call4:"+call_to4);
			// System.out.println("call5:"+call_to5);
			//  System.out.println("call6:"+call_to6);
		 	// System.out.println("call7:"+call_to7);
			// System.out.println("------****-------"); 

 //call_to1 = new String(call_to1.getBytes("ISO8859-1"),"UTF-8");
 //call_to2 = new String(call_to2.getBytes("ISO8859-1"),"UTF-8");
// call_to3 = new String(call_to3.getBytes("ISO8859-1"),"UTF-8");
 //call_to4 = new String(call_to4.getBytes("ISO8859-1"),"UTF-8");
// call_to5 = new String(call_to5.getBytes("ISO8859-1"),"UTF-8");
 //call_to6 = new String(call_to6.getBytes("ISO8859-1"),"UTF-8");
 //call_to7 = new String(call_to7.getBytes("ISO8859-1"),"UTF-8");
 //call_from = new String(call_from.getBytes("ISO8859-1"),"UTF-8");


//System.out.println("--之后----******---"); 
			//System.out.println("call1:"+call_to1);
			//System.out.println("call2:"+call_to2);
			//System.out.println("call3:"+call_to3);
			//System.out.println("call4:"+call_to4);
			//System.out.println("call5:"+call_to5);
			//System.out.println("call6:"+call_to6);
			//System.out.println("call7:"+call_to7);
			//System.out.println("------****-------"); 

//System.out.println("******接收到的adddddcall_from:"+call_from);

String calledNumStr = "";
if(call_to1 != null && !call_to1.equals("")){
	calledNumStr += call_to1 + ";";
}
if(call_to2 != null && !call_to2.equals("")){
	calledNumStr += call_to2 + ";";
}
if(call_to3 != null && !call_to3.equals("")){
	calledNumStr += call_to3 + ";";
}
if(call_to4 != null && !call_to4.equals("")){
	calledNumStr += call_to4 + ";";
}
if(call_to5 != null && !call_to5.equals("")){
	calledNumStr += call_to5 + ";";
}
if(call_to6 != null && !call_to6.equals("")){
	calledNumStr += call_to6 + ";";
}
if(call_to7 != null && !call_to7.equals("")){
	calledNumStr += call_to7 ;
}
 
  //System.out.println("保留的CALL>>>>:"+calledNumStr);





%>



<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> 
<wml>
    <head>
        <meta http-equiv="Cache-Control" content="max-age=3600"/>
    </head>
    
    <card id='add_called_num' title='118166多方通话'>
    	<p align='center'><strong>请选择号码(*可以多选*)</strong></p>
    	<p >
    		<%if(list == null || list.size() == 0){
    			%>
    			sorry,电话簿没有记录!
    			<%
    		}else{%>
    		
    		
    		<select name='called_nums' multiple='true' >
    			<%
    				String name = "";
    			 	String called_num = "";
    			 	String name_value= "";
    				for(int i = 0; i < list.size(); i++){
    			 	
    			 		name = ((DBObject)list.get(i)).getField("name");
    			 		//System.out.println((i+1)+"姓名:"+name);
    			 		//name = new String(name.getBytes("UTF-8"),"UTF-8");
    			 		
    			 		called_num =((DBObject)list.get(i)).getField("tel1");
    			 		//called_num = new String(called_num.getBytes("UTF-8"),"UTF-8");
    			 		
    			 		if(called_num == null || called_num.equals("")){
    			 			called_num =((DBObject)list.get(i)).getField("tel2");
    			 		}
    			 		name_value = "("+name.trim()+")" +called_num;
    			 		//System.out.println((i+1)+"姓名+值:"+name_value);
    			 		//name_value =  new String(name_value.getBytes("UTF-8"),"UTF-8");
    			 	%>
    			<option value='<%=name_value %>'><%=name_value %></option>
    			<% } %>
    		</select>	 
    			 
    		<%} %>	 
    		<br/>
    	 	<br/>
    		<anchor >确认 
    			<go href='manycall_user.jsp?id=<%=idStr %>' method='post'    >
    				 <postfield name='called_nums' value='$(called_nums)' /> 
    				 <postfield name='calledNumStr' value='<%=calledNumStr %>' /> 
    				 <postfield name="call_from" value="<%=call_from%>"/>
    			</go>
    		</anchor>
    		&nbsp;&nbsp;&nbsp;<br/>
    		<anchor >返回
    			<go href='manycall_user.jsp?id=<%=idStr %>' method='post'   > 
    				<postfield name="call_from" value="<%=call_from%>"/>
    				<postfield name='calledNumStr' value='<%=calledNumStr %>' />
    			</go>
    		</anchor>
    	</p> 
    </card>
</wml> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -