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

📄 bestnewslist.jsp

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ page import='java.io.*,java.text.*,java.util.*,java.util.Date,java.util.Vector, java.sql.*, com.entaz.lib.db.*, com.entaz.relay.net.*' contentType='text/html;charset=euc-kr'%>
<%@ include file="formatUtil.jsp"%>
<%@ include file="../imgpath.jsp"%>
<%@ include file="../common_func.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<%
	String mphone= request.getParameter("mphone");
	if (!mphone.isEmpty() && mphone != null)
		mphone = getStrPhone(getLong(mphone));
	String gphone= request.getParameter("gphone");
	if (!gphone.isEmpty() && gphone != null)
		gphone = getStrPhone(getLong(gphone));
	String SearchType = request.getParameter("SearchType");


	
	if (SearchType.isEmpty() || SearchType == null)
		SearchType = "0";
	
	//mphone = "013269404404";
	//gphone = "013269404303";
	
	/*------------------------------------------------------------------------------------------------------
	+	傈开 函荐
	-------------------------------------------------------------------------------------------------------*/
	String		sql					= null;
	String		strNickname			= null;
	String		guestPhone			= null;
	String		title				= null;
	int			reCount				= 0;
	String		regdate				= null;
	int			tltleIdx			= 0;
	
	/*------------------------------------------------------------------------------------------------------
	+	Page
	-------------------------------------------------------------------------------------------------------*/
	String 		pageurl 			= null;
	
	// 其捞瘤 备泅 眠啊 函荐 
	int 		pagesize 			= 10;  // 茄其捞瘤寸 10俺 免仿拱

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

	int 		absolutepage		= 1;  // 例措 困摹 其捞瘤 锅龋
    int 		dbcount				= 0;   //  DB 救俊 臂 肮荐 历厘 函荐
	int 		isNoPage 			= 0;	//茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
	
	String 		strJSPLink			= "";   //link jsp
	
	/*------------------------------------------------------------------------------------------------------
	+	DB 包访 函荐
	-------------------------------------------------------------------------------------------------------*/
	Connection				con		= null;
	PreparedStatement		pstmt	= null;
	PreparedStatement		pstmt1	= null;
	Statement				stmt	= null;
	ResultSet				rs		= null;
	ResultSet 				rs1     = null;
	ResultSet				rsDate	= null;
	
	/*--------------------------------------------------------------------------------
	+    郴啊 荤侩窍绰 函荐 
	---------------------------------------------------------------------------------*/
	int			iIdx			= 0;
	String		strNewsTitle	= "";
	int			iNewsReCnt		= 0;
	String		strRegdate		= "";
	int			iNewsKind		= 0;
	String		strFriendPhone	= "";
	int			iQueryType		= 0;
	int			iCount			= 0;
	String		strSql			= "";
	String 		nickName		= "";
	String		strNewsKind		= "";
	
	try
	{
	
	/*------------------------------------------------------------------------------------------------
	 *		DB 目池记
	 -------------------------------------------------------------------------------------------------*/
	%><%@ include file="../getConnection.jsp"%>
	<%@ include file="bgColor.jsp"%>
	<%
	/*------------------------------------------------------------------------------------------------
	 *		Host nickName
	 -------------------------------------------------------------------------------------------------*/

	sql = "SELECT NICKNAME FROM GT_USER_INFO WITH (READUNCOMMITTED) WHERE PHONENUM = '" + gphone + "'";
	pstmt = con.prepareStatement(sql);
	rs = pstmt.executeQuery();
	
	if(rs.next())
	{
		nickName = rs.getString("NICKNAME");
	}
	rs.close();
	pstmt.close();
	
	/*------------------------------------------------------------------------------------------------
	 *		pageCount
	 -------------------------------------------------------------------------------------------------*/
	sql = "SELECT COUNT(*) FROM GT_NSBEST WITH (READUNCOMMITTED) ";
	if (SearchType.equals("0"))
		sql = sql + " WHERE board_kind <> " + Integer.parseInt(SearchType);
	else
		sql = sql + " WHERE board_kind = " + Integer.parseInt(SearchType);
	
	pstmt = con.prepareStatement(sql);
	
	rs = pstmt.executeQuery();
	
	if(rs.next()){
		dbcount = rs.getInt(1);  // 臂 醚 肮荐
		rs.close();
		pstmt.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;
	}

	/*------------------------------------------------------------------------------------------------
	 *		Research Title List
	 -------------------------------------------------------------------------------------------------*/
	sql = "SELECT * FROM ( ";
	sql = sql + " SELECT a.idx, a.phonenum, a.kind, a.title, a.reCnt, b.regdate, b.board_kind FROM GT_NSNEWS a WITH (READUNCOMMITTED) , GT_NSBEST b WITH (READUNCOMMITTED) ";
	sql = sql + " WHERE a.IDX = b.BOARD_IDX and b.board_kind = 1 union all SELECT a.idx, a.phonenum, a.kind, a.title, a.reCnt, b.regdate, b.board_kind ";
	sql = sql + " FROM GT_NSQuiz a WITH (READUNCOMMITTED) , GT_NSBEST b WITH (READUNCOMMITTED) WHERE a.IDX = b.BOARD_IDX and b.board_kind = 2 ";
	sql = sql + " union all SELECT a.idx, a.phonenum, 0, a.title, a.provision1cnt + a.provision2cnt + a.provision3cnt + a.provision4cnt + a.provision5cnt reCnt, b.regdate, b.board_kind ";
	sql = sql + " FROM GT_NsResearch a WITH (READUNCOMMITTED) , GT_NSBEST b WITH (READUNCOMMITTED) WHERE a.IDX = b.BOARD_IDX and b.board_kind = 3  ) c ";
	
	if (SearchType.equals("0"))
		sql = sql + " WHERE c.board_kind <> " + Integer.parseInt(SearchType);
	else
		sql = sql + " WHERE c.board_kind = " + Integer.parseInt(SearchType);
	sql = sql + " ORDER BY c.regdate DESC, c.board_kind DESC "; 
	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>
<title></title>
<link href="http://entaz.mugeta.com/client/mugeta_v2_test/web/user/mobile.css" rel="stylesheet" type="text/css">
</head>
<body>
	
<table width="176" border="0" cellspacing="0" cellpadding="0">
	<!-- 鸥捞撇 矫累 -->
	<tr>
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr height="19">
					<td width="8" bgcolor="<%=mainBgColor%>"></td>
					<td bgcolor="<%=mainBgColor%>"><font color="#ffffff">眠玫春胶格废</font></td>
				</tr>
			</table>
		</td>
	</tr>
	<!-- 鸥捞撇 场 -->

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

	<!-- 鸥捞撇 牧刨明 矫累 -->
	<tr>
		<td align="center">
			<form action="bestNewsList.jsp" name="form" method="Post">			
			<input type="hidden" name="mphone" value="<%=mphone%>">
			<input type="hidden" name="gphone" value="<%=gphone%>">
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td></td>
					<td width="74" align="right">
						<select align="center" valign="middle" name="SearchType">
								<option value="0" <%if(SearchType.equals("0")) out.print("selected='selected'"); %>>傈眉</option>
								<option value="1" <%if(SearchType.equals("1")) out.print("selected='selected'"); %>>弥脚春胶</option>
								<option value="2" <%if(SearchType.equals("2")) out.print("selected='selected'"); %>>柠令</option>
								<option value="3" <%if(SearchType.equals("3")) out.print("selected='selected'"); %>>汲巩炼荤</option>
						</select>
					</td>
					<td width="2"></td>
					<td width="33" height="17" bgcolor="<%=mainBgColor%>" align="center"><a href="javascript:document.form.submit()"><font color="#ffffff">犬牢</font></a></td>
					<td width="20"></td>
				</tr>
			</table>
			</form>
		</td>
	</tr>
	<!-- 鸥捞撇 牧刨明 场 -->

	<!-- 咯归 矫累 -->
	<tr height="6">
		<td></td>
	</tr>
	<!-- 咯归 场 -->
	
	<!--捞傈/促澜 傅农 冠胶 矫累-->

⌨️ 快捷键说明

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