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

📄 lovemng_zp.jsp.svn-base

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 SVN-BASE
字号:
<!--------------------------------------------------------------------------------------------------------------
*@霸烙皋牢
*@Author : zhou peng(2008-06-05)


--------------------------------------------------------------------------------------------------------------->

<%@ page import='java.io.*,java.text.*,java.util.Date,java.util.Vector, java.sql.*, com.entaz.lib.db.*, com.entaz.relay.net.*' contentType='text/html;charset=euc-kr'%>
<%@ include file="../imgpath.jsp"%>
<%@ include file="../common_func.jsp"%>
<%!
	public static String isNull(String str) 
	{ 
		if (str == null) 
		return ""; 
		else 
		return str;
	} 
%>
<%
/**
	 *	
	 *
	 *	@ version			:	1.0.0
	 *	@ author			:	zhou peng ( pengzhou@isoftstone.com )
	 *	@ last modified	:	2008-05-23
	 */
	/*------------------------------------------------------------------------------------------------------
	+		扁夯 颇扼固磐
	-------------------------------------------------------------------------------------------------------*/
	String mphone= request.getParameter("mphone");
	String gphone= request.getParameter("gphone");
	//mphone = "1020591111";
	//gphone = "1020592222";



	/*------------------------------------------------------------------------------------------------------
	+	傈开 函荐
	-------------------------------------------------------------------------------------------------------*/
	String		sql					= null;
	String		strNickname			= null;
	String		strOppNickname		= null;
	int			age					= 0;
	int			sex					= 1;
	int			sysYear				= 0;
	int			answerCount			= 0;
	int			questionCount		= 0;
	int			oppCount			= 0;
	int			taroCount			= 0;
	int			oppRightCount		= 0;
	String		strGuestphone		= null;
	int 		attentionPoint 		= 0;
	int			myAttentionPoint	= 0;
	String		title				= null;
	String		answer				= null;
	String		regdate				= null;
	String		guestPhone			= null;
	String		text				= null;
	// 其捞瘤 备泅 眠啊 函荐 
	int 		pagesize 			= 4;  // 茄其捞瘤寸 10俺 免仿拱

	// 傈开 函荐肺 急攫.. 其捞瘤 备泅 何盒俊 犁荤侩
	int 		pageNUM				= 1;  // 其捞瘤 锅龋
	int 		pagecount			= 1 ; // 其捞瘤 肮荐 瘤沥 函荐

	int 		absolutepage		= 1;  // 例措 困摹 其捞瘤 锅龋
    int 		dbcount				= 0;   //  DB 救俊 臂 肮荐 历厘 函荐
	int 		isNoPage 			= 0;	//茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
	String		szCount				= null;
	String 		pageurl 			= null;
	int queryCondition = 0;
	
	if(request.getParameter("queryCondition")!=null) queryCondition=Integer.parseInt(request.getParameter("queryCondition")); else queryCondition=0;
	
	
	/*------------------------------------------------------------------------------------------------------
	+	DB 包访 函荐
	-------------------------------------------------------------------------------------------------------*/
	Connection				con		= null;
	PreparedStatement		pstmt	= null;
	Statement				stmt	= null;
	ResultSet				rs		= null;
	ResultSet 				pageset = null;
	ResultSet				rs1		= null;
	
	try
	{
	
	/*------------------------------------------------------------------------------------------------
	 *		DB 目池记
	 -------------------------------------------------------------------------------------------------*/
	%><%@ include file="../getConnection.jsp"%><%
	/*------------------------------------------------------------------------------------------------
	 *		My nickName
	 -------------------------------------------------------------------------------------------------*/

	sql = " select  nickname from GT_User_Info  WHERE   phonenum='"+mphone+"'" ; 

	pstmt = con.prepareStatement(sql);
	
	rs = pstmt.executeQuery();
		 
	if( rs.next() )
	{
		strNickname = rs.getString("nickname");
	}else{
		strNickname = "绝澜";
	}
	rs.close();
	pstmt.close();
	/*------------------------------------------------------------------------------------------------
	 *		pageCount
	 -------------------------------------------------------------------------------------------------*/
	//sql = "select count(*) from gt_lucky_taro ta,gt_lucky_taro_comment co,GT_User_Info us where ta.idx=co.taro_idx and us.phonenum=co.phonenum and ta.phonenum='"+mphone+"'" ;
	sql = "select count(*)  from ( ";
	sql = sql +" select a.sex , a.phonenum , a.nickname , (substring(convert(varchar(8),getDate(),112),0,5)-a.year+1) age , max(b.text) text , max(b.regdate) regdate   from  gt_lucky_love b , GT_User_Info a ";
	sql = sql + "where (a.phonenum in (select phonenum from gt_lucky_love where phonenum!="+Long.parseLong(mphone)+" and guest_phone="+Long.parseLong(mphone)+") or a.phonenum in (select guest_phone from  gt_lucky_love where phonenum="+Long.parseLong(mphone)+" and guest_phone!="+Long.parseLong(mphone)+"))";
	sql = sql +" group by a.phonenum , a.nickname ,a.year , a.sex) m left join gt_lucky_attention_point n on m.phonenum = n.guest_phone  ";
	pstmt = con.prepareStatement(sql);
	
	pageset = pstmt.executeQuery();
	
	if(pageset.next()){
		dbcount = pageset.getInt(1);  // 臂 醚 肮荐
		pageset.close();
	}
	
	if(dbcount%pagesize == 0)
		pagecount = dbcount/(pagesize); // 醚 其捞瘤荐 备窍扁
	else
		pagecount = dbcount/(pagesize)+1; // 醚 其捞瘤荐 备窍扁

	if(request.getParameter("pageNUM")!=null)
	{
		pageNUM=Integer.parseInt(request.getParameter("pageNUM"));//瘤沥等 其捞瘤 焊咯林扁
		absolutepage=(pageNUM-1)*pagesize+1;
	}
	/*------------------------------------------------------------------------------------------------
	 *		guestPhone List
	 -------------------------------------------------------------------------------------------------*/
	 //sql = "select us.nickname,us.sex,(substring(convert(varchar(8),getDate(),112),0,5)-us.year) age,co.phonenum,convert(char(10),co.regdate,102) regdate,ta.text  ";
		//sql = sql +" from gt_lucky_taro ta,gt_lucky_taro_comment co,GT_User_Info us where ta.idx=co.taro_idx and us.phonenum=co.phonenum and ta.phonenum='"+mphone+"' order by co.regdate desc" ; 
		sql = "select m.sex , m.phonenum , m.nickname ,m.age,m.text ,convert(char(10),m.regdate,102) regdate ,isNull(n.attention_point,0) attention_point  from ( ";
		sql = sql +" select a.sex , a.phonenum , a.nickname , (substring(convert(varchar(8),getDate(),112),0,5)-a.year+1) age , max(b.text) text , max(b.regdate) regdate   from  gt_lucky_love b , GT_User_Info a ";
		sql = sql + "where (a.phonenum in (select phonenum from gt_lucky_love where phonenum!="+Long.parseLong(mphone)+" and guest_phone="+Long.parseLong(mphone)+") or a.phonenum in (select guest_phone from  gt_lucky_love where phonenum="+Long.parseLong(mphone)+" and guest_phone!="+Long.parseLong(mphone)+"))";
	
	if (queryCondition == 0){
	
		sql = sql +" group by a.phonenum , a.nickname ,a.year , a.sex) m left join gt_lucky_attention_point n on m.phonenum = n.guest_phone  order by regdate asc ";
		
	}else if (queryCondition == 1){
	
		sql = sql +" group by a.phonenum , a.nickname ,a.year , a.sex) m left join gt_lucky_attention_point n on m.phonenum = n.guest_phone  order by  attention_point desc ";
		
	}else if (queryCondition == 2){
		
		sql = sql +" group by a.phonenum , a.nickname ,a.year , a.sex) m left join gt_lucky_attention_point n on m.phonenum = n.guest_phone  order by  attention_point asc ";
		
	}else if (queryCondition == 3){
	
		sql = sql +" group by a.phonenum , a.nickname ,a.year , a.sex) m left join gt_lucky_attention_point n on m.phonenum = n.phonenum  order by attention_point desc";
		
	}else if (queryCondition == 4){
	
		sql = sql +" group by a.phonenum , a.nickname ,a.year , a.sex) m left join gt_lucky_attention_point n on m.phonenum = n.phonenum  order by attention_point asc ";
				
	}
	pstmt = con.prepareStatement(sql);
	
	rs = pstmt.executeQuery();
	
	if(!rs.next()) // 蔼捞 绝阑锭
	{
		isNoPage = 1;
		pagesize=0;
	}
	else         // 蔼捞 乐阑锭	//rs.absolute(absolutepage);
	{				
		for(int s=0; s<absolutepage-1; s++)
			rs.next();
	}
	// QVGA HTML
	//
	if( isQVGA )
	{
		%><%@ include file="/html/LoveMng_zp.jsp"%><%
	}
	// QCIF HTML
	//
	else
	{
		%><%@ include file="/html/qcif/LoveMng_zp.jsp"%><%
	}
		}
	catch(Exception e)
	{
		throw e;
	}
	finally
	{ 
		if ( rs != null ) { try { rs.close(); } catch ( Exception e ) { } }
		if ( stmt != null ) { try { stmt.close(); } catch ( Exception e ) { } }
		if ( con != null ) { try { con.close(); } catch ( Exception e ) { } }
	}
%>

⌨️ 快捷键说明

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