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

📄 myquizview.jsp

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ 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"%>
<%@ include file="appConstants.jsp"%>
<%@ include file="formatUtil.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<style  type="text/css">  
A:hover {
 COLOR: #000000; TEXT-DECORATION: underline
}
A:link {
 COLOR: #000000; TEXT-DECORATION: underline
}
A:visited {
 COLOR: #000000; TEXT-DECORATION: underline
}
</style> 
<%!public static String isNull(String str) {
		if (str == null)
			return "";
		else
			return str;
}%>
<%
	 /*------------------------------------------------------------------------------------------------------
	 +	扁夯 颇扼固磐
	 -------------------------------------------------------------------------------------------------------*/
	String mphone = request.getParameter("mphone");
	String gphone = request.getParameter("gphone");
	if(mphone == null){
		mphone= "09900100081";
	}	
	if(gphone == null){
		gphone = mphone;
	}
	mphone = getStrPhone(getLong(mphone));
 	gphone = getStrPhone(getLong(gphone));
	String idx = request.getParameter("idx");
	String name =  java.net.URLDecoder.decode(makeKOR(request.getParameter("name")));
	String upFlag = request.getParameter("upFlag");
	/*------------------------------------------------------------------------------------------------------
	 +	其捞瘤 函荐
	 -------------------------------------------------------------------------------------------------------*/
	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, query3 = null, query4 = null, query5 = null, query6 = null, sql = null, sql1 = null, sql2 = null, sql3 = null;
	String szCount = "";
	String pageurl = url_path + "/news/myQuizView.jsp?mphone="+ mphone + "&gphone=" + gphone + "&idx=" + idx
						+ "&name=" + name + "&upFlag=" + upFlag;
	int answerCount = 0;
	int kind = 0;
	String title = "";
	String text = "";
	int reCnt = 0;
	int seCnt = 0;
	String date = "";
	int re_idx = 0;
	String re_phonenum = "";
	String re_name = "";
	String re_text = "";
	int ref_idx = 0;
	int flag = 0;
	String re_date = "";
	String phonenum = "";
	int takeIdx = 0;
	int id_check = 0;
	String		strNewsKind			= "";			//臂 辆幅
	int			cStringTypeLength	= 0;
	String		strPrintNewsTitle	= "";			//臂 力格 (畴免窍绰)
	int			takeFlag			= 0;
	String		placeTopColor		= null;
	%>
<%
	try {
	/*------------------------------------------------------------------------------------------------
	 *		DB 目池记
	 -------------------------------------------------------------------------------------------------*/
%>
<%@ include file="../getConnection.jsp"%>
<%@ include file="bgColor.jsp"%>
<%!
	 public String getTime(String input)
	 {
	  return input.substring(2,4)+"/"+input.substring(5,7)+"/"+input.substring(8,10)+" "+input.substring(11,16);
	 }
%>
<%
	/*------------------------------------------------------------------------------------------------
		 *		匙  name 啊廉坷促 
	 -------------------------------------------------------------------------------------------------*/
	sql = "SELECT  nickname  FROM GT_user_info WITH (READUNCOMMITTED)  WHERE  phonenum ='"
	+ gphone + "'";
	pstmt = con.prepareStatement(sql);
	rs = pstmt.executeQuery();
	if (rs.next()) {
		name = rs.getString(1);
	}
	rs.close();
	pstmt.close();
	 /*------------------------------------------------------------------------------------------------
	 *		郴 柠令狼 瘩臂  饭内靛
	 -------------------------------------------------------------------------------------------------*/
	query1 = "SELECT count(idx) AS answerCount FROM  GT_NsQuizRe WITH (READUNCOMMITTED) WHERE  ref_idx = "
	+ idx;
	pstmt = con.prepareStatement(query1);
	rs = pstmt.executeQuery();
	if (rs.next()) {
		answerCount = rs.getInt("answerCount");
	}
	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;
	}
	/*------------------------------------------------------------------------------------------------
	 *		炼雀荐 刘啊 1 /炼雀 痢荐 刘啊1
	 -------------------------------------------------------------------------------------------------*/
	if (!mphone.equals(gphone)) {
		query2 = "UPDATE GT_NsQuiz SET  seCnt = seCnt+1 WHERE idx= "
		+ idx;
		pstmt = con.prepareStatement(query2);
		pstmt.executeUpdate();
		pstmt.close();
	
		query5 = "SELECT idx  FROM GT_NsLevelset WITH (READUNCOMMITTED) WHERE phonenum="
		+ gphone;
		pstmt = con.prepareStatement(query5);
		rs = pstmt.executeQuery();
		if (rs.next()) {
		id_check = rs.getInt(1);
		}
		if (id_check == 0) {
		query6 = "INSERT INTO GT_NsLevelSet(phonenum, nickname, point_take, point_hit)"
				+ "VALUES(convert(bigint,"
				+ gphone
				+ "),'"
				+ name + "',0,0)";
		pstmt = con.prepareStatement(query6);
		pstmt.executeUpdate();
		pstmt.close();
		}
	
		query4 = "UPDATE GT_NsLevelset SET point_hit = point_hit+1 WHERE phonenum ="
		+ gphone;
		pstmt = con.prepareStatement(query4);
		pstmt.executeUpdate();
		pstmt.close();
	}
	/*------------------------------------------------------------------------------------------------
	 *		匙 柠令 惑技 
	 -------------------------------------------------------------------------------------------------*/
		query3 = " SELECT idx,kind,title,text,reCnt,seCnt,takeIdx,regdate "
		+ " FROM GT_NsQuiz WITH (READUNCOMMITTED) "
		+ " WHERE idx = "
		+ idx
		+ " ORDER BY regdate DESC";
		pstmt = con.prepareStatement(query3);
		rs = pstmt.executeQuery();
	if (rs.next()) {
		kind = rs.getInt(2);
		title = rs.getString(3);
		text = rs.getString(4);
		reCnt = rs.getInt(5);
		seCnt = rs.getInt(6);
		takeIdx = rs.getInt(7);
		date = rs.getString(8);
	}
		rs.close();
		pstmt.close();
%>
<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="240" border="0" cellspacing="0" cellpadding="0">
			<!-- 鸥捞撇 矫累 -->
			<tr>
				<td>
					<table width="240" 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="8">
				<td></td>
			</tr>
			<!-- 咯归 场 -->
			<!-- 冠胶 矫累 -->
			<tr>
				<td>
					<table width="240" border="0" cellspacing="0" cellpadding="0"
						 bgcolor="<%=contentBgColor%>">
						<tr height="6">
							<td colspan="3"></td>
						</tr>
						<tr>
							<td width="3"></td>
							<td>
								<font color="<%=mainFontColor%>"> [<%=getType(kind)%>] </font>
								<%=title%>
								<font color="#fc3f4e"><b>[<%=reCnt%>]</b> </font>
							</td>
							<td width="3"></td>
						</tr>
						<tr height="18">
							<td width="3"></td>
							<td align="right">
								<font color="#928279" size="3">- <%=getTime(date)%>
								</font>
							</td>
							<td width="3"></td>
						</tr>
						<tr height="4">
							<td colspan="3"></td>
						</tr>
						<tr>
							<td width="3"></td>
							<td bgcolor="#ffffff">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr height="4">
										<td colspan="3"></td>
									</tr>
									<tr>
										<td width="4"></td>
										<td>
											<%=text%>
										</td>
										<td width="4"></td>
									</tr>
									<tr>
										<td width="4"></td>
										<td align="right">
											<font color="#7c8889" size="3">炼雀荐<%=seCnt%></font>
										</td>
										<td width="4"></td>
									</tr>
									<tr height="4">
										<td colspan="3"></td>
									</tr>
								</table>
							</td>
							<td width="3"></td>
						</tr>
						<tr height="3">
							<td colspan="3"></td>
						</tr>
						<!-- 滚瓢 矫累 -->
						<tr>
							<td width="3"></td>
							<td>
								<%
								if (mphone.equals(gphone)) {
								%>
								<table border="0" cellspacing="0" cellpadding="0">
									<tr height="17">
										<td></td>
										<td width="70" bgcolor="#ffffff" align="center">
											<a href="<%=url_path%>/news/myQuizModify0.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>&name=<%=name%>&idx=<%=idx%>&kind=<%=kind%>&text=<%=text%>&title=<%=title%>&upFlag=<%=upFlag%>">
												<font color="<%=btnFontColor%>"> <%
								 if (upFlag.equals("0")) {
								 %> 荐沥/昏力 <%
								 } else {
								 %> 荐沥 <%
								 }
								 %> </font> </a>
										</td>
										<td width="2"></td>
										<td width="70" bgcolor="#ffffff" align="center">
											<a href="<%=url_path%>/news/myQuizAnswerAdd.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>&name=<%=name%>&idx=<%=idx%>&upFlag=<%=upFlag%>">
												<font color="<%=btnFontColor%>">瘩臂累己</font> </a>
										</td>
										<td></td>
									</tr>
								</table>
								<%
								} else {
								%>
								<table border="0" cellspacing="0" cellpadding="0">
									<tr height="17">
										<td></td>
										<td width="70" bgcolor="#ffffff" align="center">
											<a href="<%=url_path%>/news/myQuizAnswerAdd.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>&name=<%=name%>&idx=<%=idx%>&upFlag=<%=upFlag%>">
											<font color="<%=btnFontColor%>">瘩臂累己</font> </a>
										</td>
										<td></td>
									</tr>
								</table>
								<%
								}
								%>
							</td>
							<td width="3"></td>
						</tr>
						<!-- 滚瓢 场 -->
						<tr height="3">
							<td colspan="3"></td>
						</tr>
					</table>
				</td>
			</tr>
			<!-- 冠胶 场 -->
			<!--咯归 矫累-->
			<tr>
				<td height="11"></td>
			</tr>
			<!--咯归 场-->
			<%
			if (answerCount != 0) {
			%>
			<!--捞傈/促澜 傅农 冠胶 矫累-->

			<%
						String[] szSplit = pagePathTop(pageurl, dbcount, pageNUM,pagecount);
			%>
			 <tr>
		    	<td>
		    		<table width="240"  border="0" cellspacing="0" cellpadding="0" bgcolor="<%=pageBgColor %>">
		    		<tr>
		     		<td width="25"></td>
		      		<td  width="60" height="19" align="left"><font color="#676767" size="3">⒏ </font><font color="<%=pageFNFontColor %>" size="3">(7)</font><%=szSplit[0]%><b><font color="<%=pageFNFontColor %>" size="3">捞傈</font></b><%=szSplit[1]%></td>
		     		<td></td>
		     		<td   width="60"  height="19" align="right"><%=szSplit[2]%><b><font color="<%=pageFNFontColor %>" size="3">促澜</font></b><%=szSplit[3]%><font color="<%=pageFNFontColor %>" size="3">(9)</font><font color="#676767" size="3"> ⒑</font></td>
		     		<td width="25"></td>
		     		</tr>
		     		</table>
		    	</td>
		    </tr>
			<!--捞傈/促澜 傅农 冠胶 场-->
			<!--咯归 矫累-->
			<tr>
				<td height="3"></td>
			</tr>
			<!--咯归 场-->
			<!-- 瘩臂焊扁 矫累 -->
			<tr height="19">
				<td bgcolor="<%=btnFontColor%>">
					<font color="#ffffff"> ″ 瘩臂焊扁</font>
				</td>
			</tr>
			<%

⌨️ 快捷键说明

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