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

📄 questionlist.jsp

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 JSP
字号:
<!--------------------------------------------------------
* @ 权 > Xxx丛狼 迄乔 > 家匡皋捞飘 > 鸥肺痢
* @ Author : 碍辑康 ( 2008-05-22)
* @ Images : 其捞瘤 救俊 甸绢啊绰 捞固瘤
----------------------------------------------------------->
<%@ 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;
	} 
%>
<%

	/*------------------------------------------------------------------------------------------------------
	+	扁夯 颇扼固磐
	-------------------------------------------------------------------------------------------------------*/
	
	String mphone = request.getParameter("mphone");
	String gphone = request.getParameter("gphone");
	
	/*------------------------------------------------------------------------------------------------------
	+	其捞瘤 函荐
	-------------------------------------------------------------------------------------------------------*/	
	
	int pageNUM=1;    // 其捞瘤 锅龋
	int absolutepage=1;  // 例措 困摹 其捞瘤 锅龋
    int dbcount=0 ;   //  DB 救俊 臂 肮荐 历厘 函荐
	int isNoPage = 0;	//茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
	int recordCount=0; //其捞隆 且 饭内靛 墨款飘
	int pagesize=10;		//其捞瘤 府胶飘 荐
	int pagecount=1;		//其捞瘤 荐
	int gotoPage=1;		//其捞瘤 逞滚
	
	
	/*------------------------------------------------------------------------------------------------------
	+	DB 包访 函荐
	-------------------------------------------------------------------------------------------------------*/	
	
	Connection con = null;
	PreparedStatement pstmt=null;
	Statement stmt = null;
	ResultSet rs = null;
	ResultSet pageset = null;

	/*------------------------------------------------------------------------------------------------------
	+	傈开 函荐
	-------------------------------------------------------------------------------------------------------*/
	String query1=null , query2 = null ,sql = null;
	int idx = 0;
	int phonenum = 0;
	String text = "";
	int date = 0;
	int questionCount = 0 ;
	String szCount ="";
	String name = "";
	String pageurl = url_path+"/soulmate/questionList.jsp?mphone="+mphone+"&gphone="+gphone;
 %>


<%
try
{
	/*------------------------------------------------------------------------------------------------
	 *		DB 目池记
	 -------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
	
	con.setAutoCommit(false);
	stmt=con.createStatement();
	


	/*------------------------------------------------------------------------------------------------
	 *		郴 鸥肺  龙巩  饭内靛
	 -------------------------------------------------------------------------------------------------*/
	 query1 = "select count(idx) as questioncount from  GT_LUCKY_TARO WITH (READUNCOMMITTED) where  phonenum = "+ mphone ;
	 pstmt = con.prepareStatement(query1);
	 rs = pstmt.executeQuery();
	 if(rs.next()){
	 	questionCount = rs.getInt("questioncount");
	 }
	 rs.close();
	 pstmt.close();	
	/*------------------------------------------------------------------------------------------------
	 *		其捞瘤 
	 -------------------------------------------------------------------------------------------------*/	 
	 
	szCount = query1;
	pstmt = con.prepareStatement(szCount);
	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;
	}
	
	/*------------------------------------------------------------------------------------------------
	 *		匙  name 啊廉坷促 
	 -------------------------------------------------------------------------------------------------*/
	sql = "select  nickname  from GT_user_info WITH (READUNCOMMITTED) where  phonenum ='"+mphone+"'";
	pstmt = con.prepareStatement(sql);
	rs = pstmt.executeQuery();
	if(rs.next()){
	name = rs.getString("nickname");
	}
	
 %>

<html>
<head>
	<link href="http://entaz.mugeta.com/client/mugeta_v2_test/web/user/mobile.css" rel="stylesheet" type="text/css">
	<title>权 > <%=name%>丛狼 迄乔 > 家匡皋捞飘 > 鸥肺痢</title>
</head>
<body>

<!--剧侥
  <tr>
     <td>
          <table width="176" border="0" cellspacing="0" cellpadding="0">
             <tr>  
  	    <td></td>
      	   </tr>
          </table>
     </td>
  </tr>
-->
<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" height="16" border="0" cellspacing="0" cellpadding="0">	
				<tr>
					<td></td>
					<td width="86" height="16" bgcolor="#c789ff" align="center"><a href="<%=url_path%>/soulmate/questionAdd.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>"><font color="#ffffff">鸥肺痢 龙巩 殿废</font></a></td>
					<td width="3"></td>
				</tr>
			</table>
		</td>
	</tr>
	<!--龙巩 殿废 滚瓢 场-->

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

	<!--捞傈俊 夯 鸥肺痢 府胶飘 矫累-->
	<tr> 
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td><font color="#ecaaff">≮ </font><font color="#616667">捞傈俊 龙巩茄 郴侩</font></td>
				</tr>
				<tr>
					<td height="3"></td>
				</tr>
				<tr>
					<td>
						<!--捞傈/促澜 傅农 冠胶 矫累-->
						<table width="176" bgcolor="#c789ff" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td bgcolor="#e8f2f2" align="center">
							   <%
							    pageurl=url_path+"/soulmate/questionList.jsp?mphone="+mphone;
							    out.println(pagePath(pageurl, dbcount, pageNUM, pagecount));
							   %>
								</td>
							</tr>
						</table>
						<!--捞傈/促澜 傅农 冠胶 场-->
					</td>
				</tr>
				<tr>
					<td height="7"></td>
				</tr>
<%
	if(questionCount == 0){
%>
				<tr>
					<td>
						<!--龙巩郴侩1 冠胶 矫累-->
						<table width="176" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="5"></td>
								<td><font color="#9819e9">钎矫且 郴侩捞 绝嚼聪促.</font></td>
								<td width="5"></td>
							</tr>
							<tr>
								<td colspan="3" height="3"></td>
							</tr>
						</table>
						<!--龙巩郴侩1 冠胶 场-->
					</td>
				</tr>
<%
	}else{
	/*------------------------------------------------------------------------------------------------
	 *		郴 鸥肺  龙巩  LIST 
	 -------------------------------------------------------------------------------------------------*/
	query2 = "  select 	   idx,phonenum,comment,text,nregdate,regdate "+
			 "	from 	   GT_LUCKY_TARO WITH (READUNCOMMITTED)"+
		 	 "	where	   phonenum = convert(bigint," + mphone+")"+
			 "	order by    regdate  desc ";
	pstmt = con.prepareStatement(query2);
	rs = pstmt.executeQuery();
	if(!rs.next()) // 蔼捞 绝阑锭
	{
		isNoPage = 1;
		pagesize=0;
	}
	else         // 蔼捞 乐阑锭	//rs.absolute(absolutepage);
	{				
		for(int s=0; s<absolutepage-1; s++)
			rs.next();
	}	
	int count = 0 ;
	while(count<pagesize)
	{
		count++;
		idx = rs.getInt(1);
		phonenum = rs.getInt(2);
		text = rs.getString(4);
		date = rs.getInt(5);
 		String str_date = String.valueOf(date);
		String year = str_date.substring(2,4);
		String month = str_date.substring(4,6);
		String day = str_date.substring(6,str_date.length());
 %>

				<tr>
					<td>
						<!--龙巩郴侩1 冠胶 矫累-->
						<table width="176" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td width="5"></td>
								<td><%=year%>/<%=month%>/<%=day%>&nbsp;&nbsp;龙巩 郴侩</td>
								<td width="5"></td>
							</tr>
							<tr>
								<td width="5">
									<input type="hidden" name="idx" value="<%=idx%>">
									<input type="hidden" name="pageNUM" value="<%=pageNUM%>">
								</td>
								<td><a href="<%=url_path%>/soulmate/questionDetail.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>&idx=<%=idx%>"><font color="#9819e9"> <%=text%> </font></a></td>
								<td width="5"></td>
							</tr>
							<tr>
								<td colspan="3" height="3"></td>
							</tr>
							<!--备盒 扼牢 矫累-->
							<tr>
								<td></td>
								<td height="1" bgcolor="#f7d9ff"></td>
								<td></td>
							</tr>
							<!--备盒 扼牢 场-->
						</table>
						<!--龙巩郴侩1 冠胶 场-->
					</td>
				</tr>
				<tr>
					<td height="3"></td>
				</tr>
			
<%
	if(rs.isLast())
			{ //盖 付瘤阜 饭内靛 老版快
				 break;
			}
			else
			{
				rs.next();
			}
		}
	}
 %>
			
				<tr>
					<td>
						<!--其捞瘤 傅农 矫累-->
						<table width="176" height="16" bgcolor="#e8f2f2" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="16" colspan="6" bgcolor="#e8f2f2" valign="bottom" align="center">
									
											<%//其捞瘤 备泅何
												int limit = 5 ;   //其捞瘤 府胶飘 俺荐 瘤沥	
												int temp =(pageNUM-1) % limit ;	//矫累 其捞瘤 备窍扁
												int startPage = pageNUM - temp;
											%>
											<%// [捞傈] 傅农 眠啊窍扁
											   if ((startPage-limit)>0){ %>
												<a href="<%=pageurl%>&pageNUM=<%=startPage-1%>"><font color="#DB1A00">捞傈</font></a>&nbsp;
											   <%}
											   //其捞瘤 锅龋 唱凯窍扁
											   if(isNoPage == 0)
											   {
												 for(int i=startPage ; i<(startPage+limit);i++)
												 {
												   if( i == pageNUM)
												   {%>
														<font color="#DB1A00"><b><%=i%></b></font>&nbsp;
												<% }
												   else
												   { %>
														<a href="<%=pageurl%>&pageNUM=<%=i%>"><font color="#DB1A00"><%=i%></font></a>&nbsp;
												<% }
												   if(i >= pagecount) break;
												 }
											   }
											   else
												  out.println("钎矫 且 郴侩捞 绝嚼聪促.");
											   //[促澜] 傅农 眠啊
											   if((startPage+limit)<=pagecount){ %>
												<a href="<%=pageurl%>&pageNUM=<%=(startPage+limit)%>"><font color="#DB1A00">促澜</font></a>&nbsp;
											   <%}
											%>	
								</td>
							</tr>
						</table>
						<!--其捞瘤 傅农 场-->
					</td>
				</tr>
				
			</table>
		</td>
	</tr>
	<!--捞傈俊 夯 鸥肺痢 府胶飘 场-->
				
	<tr>
		<td height="5"></td>
	</tr>
	
	<!--滚瓢 矫累-->
	<tr> 
		<td>
			<table width="176" height="16" border="0" cellspacing="0" cellpadding="0">	
				<tr>
					<td></td>
					<td width="55" height="16" bgcolor="#c789ff" align="center"><a href="<%=url_path%>/soulmate/MySoulmate.jsp?mphone=<%=mphone%>&gphone=<%=mphone%>"><font color="#ffffff">倒酒啊扁</font></a></td>
					<td></td>
				</tr>
			</table>
		</td>
	</tr>
<!--滚瓢 场-->

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

<!--窍窜 版肺钎矫 矫累-->
<%
String step1=url_path+"/main.jsp?mphone="+mphone+"&gphone="+gphone;//权
String step2=url_path+"/mypage/my_confirm.jsp?mphone="+mphone+"&gphone="+gphone;
String step3=url_path+"/soulmate/Soulmate_zp.jsp?mphone="+mphone+"&gphone="+gphone;
%>
	<tr>
		<td>
			<table width="176" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="10" bgcolor="#BBC7C8"></td>
					<td width="156" bgcolor="#DAE6E8" height="15">&nbsp;<a href="<%=step1%>">权</a>&gt;<a href="<%=step2%>"><b><%=name%></b>&nbsp;&nbsp;丛狼 迄乔</a></td>
					<td width="10" bgcolor="#BBC7C8"></td>
				</tr>
				<tr>
					<td width="10" bgcolor="#BBC7C8"></td>
					<td width="156" bgcolor="#DAE6E8" height="15">&nbsp;&nbsp;&nbsp;&nbsp;&gt;<a href="<%=step3%>">家匡皋捞飘</a>&gt;鸥肺痢</td>
					<td width="10" bgcolor="#BBC7C8"></td>
				</tr>
			</table>
		</td>
	</tr>
<!--窍窜 版肺钎矫 场-->

</table>
<!--窍窜 版肺钎矫 矫累-->
  <%@ include file="../newbottom.jsp"%>
<!--窍窜 版肺钎矫 场-->
</body>
</html>
<%
}
catch (Exception e) 
{
	out.println(e);
}
finally
{
	if(rs != null)      try{rs.close();}catch(Exception se){}
	if(pageset != null) try{pageset.close();}catch(Exception se){}
	if(pstmt != null)   try{pstmt.close();}catch(Exception es){}
	if(stmt != null)    try{stmt.close();}catch(Exception es){}
	if(con != null)		try{con.close();}catch(Exception es){}
}
%>

⌨️ 快捷键说明

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