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

📄 quizlistview_zp.jsp

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<!--------------------------------------------------------------------------------------------------------------
*@霸烙皋牢
*@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;
	List 		guestPhoneList		= new ArrayList();
	String		name				= null;
	String		guestPhone			= null;
	
	String 		pageurl 			= null;
	String		regdate				= null;
	
	// 其捞瘤 备泅 眠啊 函荐 
	int 		pagesize 			= 3;  // 茄其捞瘤寸 10俺 免仿拱

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

	int 		absolutepage		= 1;  // 例措 困摹 其捞瘤 锅龋
    int 		dbcount				= 0;   //  DB 救俊 臂 肮荐 历厘 函荐
	int 		isNoPage 			= 0;	//茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
	Iterator 	iter 				= 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				rs2		= null;
	ResultSet				rs3		= null;
	ResultSet				rs4		= null;
	ResultSet				rs5		= null;
	ResultSet				rs6		= null;
	ResultSet				rsDate	= null;
	
	try
	{
	
	/*------------------------------------------------------------------------------------------------
	 *		DB 目池记
	 -------------------------------------------------------------------------------------------------*/
	%><%@ include file="../getConnection.jsp"%><%
	/*------------------------------------------------------------------------------------------------
	 *		My nickName
	 -------------------------------------------------------------------------------------------------*/

	sql = " select  nickname from GT_User_Info WITH (READUNCOMMITTED) 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(distinct(guest_phone)) from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum!=guest_phone and phonenum="+Long.parseLong(mphone);
	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
	 -------------------------------------------------------------------------------------------------*/
	if (queryCondition == 0){
	sql = "select a.guest_phone,a.regdate from (select guest_phone,max(regdate) as regdate from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum!=guest_phone and phonenum="+Long.parseLong(mphone)+" group by guest_phone ) a order by regdate desc";
	//sql = " select guest_phone,convert(char(10),regdate,111) regdate from GT_LUCKY_QUIZ_MYLOG where phonenum!=guest_phone and phonenum="+Long.parseLong(mphone)+" order by regdate desc" ;
	}else if (queryCondition == 1){
	sql = "select a.guest_phone,a.regdate from (select guest_phone,max(regdate) as regdate from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum!=guest_phone and phonenum="+Long.parseLong(mphone)+" group by guest_phone ) a order by regdate asc";
	}
	else if (queryCondition == 2){
	sql = " select guest_phone,count(*) as coun from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum!=guest_phone and phonenum="+Long.parseLong(mphone)+"  group by guest_phone  order by coun desc" ;
	}
	else if (queryCondition == 3){
	sql = " select c.guest_phone,count(*)countNum from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED),gt_lucky_quiz b WITH (READUNCOMMITTED),gt_lucky_quiz_mylog c WITH (READUNCOMMITTED) ";
	sql = sql+" where   a.quiz_idx = b.idx and b.flag=1 and a.quiz_idx=c.quiz_idx and a.answer = c.answer ";
	sql = sql+" and a.phonenum = "+Long.parseLong(mphone)+" and a.guest_phone ="+Long.parseLong(mphone);
	sql = sql+" and c.phonenum = "+Long.parseLong(mphone);
	sql = sql+" and c.guest_phone<>"+Long.parseLong(mphone);
	sql = sql+" group by c.guest_phone ";
	sql = sql+" order by countNum desc" ;
	}
	else if (queryCondition == 4){
	sql = " select c.guest_phone,count(*)countNum from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED),gt_lucky_quiz b WITH (READUNCOMMITTED),gt_lucky_quiz_mylog c WITH (READUNCOMMITTED) ";
	sql = sql+" where   a.quiz_idx = b.idx and b.flag=1 and a.quiz_idx=c.quiz_idx and a.answer = c.answer ";
	sql = sql+" and a.phonenum = "+Long.parseLong(mphone)+" and a.guest_phone ="+Long.parseLong(mphone);
	sql = sql+" and c.phonenum = "+Long.parseLong(mphone);
	sql = sql+" and c.guest_phone<>"+Long.parseLong(mphone);
	sql = sql+" group by c.guest_phone ";
	sql = sql+" order by countNum 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();
	}
	
 %>
<html>
<head>
	<link href="http://entaz.mugeta.com/client/mugeta_v2_test/web/user/mobile.css" rel="stylesheet" type="text/css">
	<title> 权 > <%=strNickname%>丛狼 迄乔 > 家匡皋捞飘</title>
</head>
<body>
<form name="form1" action="QuizListView_zp.jsp" method="post">
<table width="176" border="0" cellspacing="0" cellpadding="0">
	<!--鸥捞撇 矫累-->
	<tr>
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td colspan="2" height="2" bgcolor="#c789ff"></td>
				</tr>
				<tr>
					<td width="6" height="14" bgcolor="#9819e9"></td>
					<td height="14" bgcolor="#9819e9"><font color="#ffffff">龙巩措翠 焊扁</font></td>
				</tr>
				<tr>
					<td colspan="2" height="2" bgcolor="#c789ff"></td>
				</tr>
				<tr>
					<td colspan="2" height="1" bgcolor="#9819e9"></td>
				</tr>
			</table>
		</td>
	</tr>
	<!--鸥捞撇 场-->

	<!--咯归 矫累-->
	<tr>
		<td height="4"></td>
	</tr>
	<!--咯归 场-->

	<!--沥纺 急琶 矫累-->
	<tr>
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td></td>
					<td width="100" align="center">
						<input name="mphone" type="hidden" value="<%=mphone%>">
						<select name="queryCondition" size="1">
							<option value="0" <%if(queryCondition==0) out.print("selected"); %>> 弥辟 巩力 乾 </option>
							<option value="1" <%if(queryCondition==1) out.print("selected"); %>> 刚历 巩力 乾 </option>
							<option value="2" <%if(queryCondition==2) out.print("selected"); %>> 啊厘 腹捞 乾 </option>
							<option value="3" <%if(queryCondition==3) out.print("selected"); %>> 腹捞 嘎冕 </option>
							<option value="4" <%if(queryCondition==4) out.print("selected"); %>> 利霸 嘎冕 </option>
						</select>
					</td>
					<td width="60" align="center" bgcolor="#c789ff"><font color="#ffffff"><a href="javascript:document.form1.submit()">鉴栏肺 焊扁</a></font></td>
					<td></td>
				</tr>
			</table>
		</td>
	</tr>
	<!--沥纺 急琶  场-->

	<!--咯归 矫累-->
	<tr>
		<td height="5"></td>
	</tr>
	<!--咯归 场--> 

	<tr>
		<td>
			<!--捞傈/促澜 傅农 冠胶 矫累-->
			<table width="176" bgcolor="#e8f2f2" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td bgcolor="#e8f2f2" align="center">
				   <%
				    pageurl=url_path+"/soulmate/QuizListView_zp.jsp?mphone="+mphone;
				    out.println(pagePath(pageurl, dbcount, pageNUM, pagecount));
				   %>
				  </td>
				</tr>
			</table>
			<!--捞傈/促澜 傅农 冠胶 场-->
		</td>
	</tr>
	<%
	int count = 0 ; //其捞瘤 墨款磐 函荐
	while(count<pagesize)
	{

	count++;
	guestPhone = rs.getString("guest_phone");
	if (queryCondition == 0 || queryCondition == 1){
	regdate =rs.getString("regdate");
	}else {
	String sqlDate = " select top 1 guest_phone,regdate from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where guest_phone="+Long.parseLong(guestPhone)+" order by regdate desc" ;
	
	pstmt = con.prepareStatement(sqlDate);
	
	rsDate = pstmt.executeQuery();
		 
	if( rsDate.next() )
	{
		regdate = rsDate.getString("regdate");
	}else{
		regdate = "";
	}
	}

	/*------------------------------------------------------------------------------------------------
	 *		My Question Count
	 -------------------------------------------------------------------------------------------------*/

⌨️ 快捷键说明

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