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

📄 myquizlist.jsp

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 JSP
字号:
<%@ 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"%>
<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;
	} 
%>
<%!
	 public String getTime(String input)
	 {
	  return input.substring(2,4)+"/"+input.substring(5,7)+"/"+input.substring(8,10)+" "+input.substring(11,16);
	 }
 %>
<%
	/*------------------------------------------------------------------------------------------------------
	+	扁夯 颇扼固磐
	-------------------------------------------------------------------------------------------------------*/
	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));
	/*------------------------------------------------------------------------------------------------------
	+	其捞瘤 函荐
	-------------------------------------------------------------------------------------------------------*/	
	
	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,sql = null;
	int quizCount = 0 ;
	String szCount ="";
	String name = "";
	String  pageurl=url_path+"/news/myQuizList.jsp?mphone="+mphone+"&gphone="+gphone;
	String bgcolor=null;
	int idx_top = 0;//top1狼 idx
	int idx = 0;
	int kind = 0;
	String title = "";
	int reCnt = 0;
	String date = "";
	int upFlag = 0;
 %>
<%
try
{
	/*------------------------------------------------------------------------------------------------
	 *		DB 目池记
	 -------------------------------------------------------------------------------------------------*/
%>
<%@ include file="../getConnection.jsp"%>
<%@ include file="bgColor.jsp"%>
<%
	
	con.setAutoCommit(false);
	stmt=con.createStatement();
	/*------------------------------------------------------------------------------------------------
	 *		郴 柠令 饭内靛
	 -------------------------------------------------------------------------------------------------*/
	 query1 = "SELECT count(idx) as quizCount FROM  GT_NsQuiz WITH (READUNCOMMITTED) WHERE  phonenum = "+ gphone ;
	 pstmt = con.prepareStatement(query1);
	 rs = pstmt.executeQuery();
	 if(rs.next()){
	 	quizCount = rs.getInt("quizCount");
	 }
	 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 ='"+gphone+"'";
	pstmt = con.prepareStatement(sql);
	rs = pstmt.executeQuery();
	if(rs.next()){
	name = rs.getString(1);
	}
	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="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">柠令<%=name%>捞具扁</font>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<!-- 鸥捞撇 场 -->
			<!-- 咯归 矫累 -->
			<tr height="4">
				<td></td>
			</tr>
			<!-- 咯归 场 -->
			<!--捞傈/促澜 傅农 冠胶 矫累-->
					<%
					  String [] szSplit = pagePathTop(pageurl, dbcount, pageNUM, pagecount);
					%>
			<tr>
				<td>			
					<table width="176" border="0" cellspacing="0" cellpadding="0" bgcolor="<%=pageBgColor %>">
						<tr>
							<td width="10"></td>
							<td  width="60" height="16" 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" 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="10"></td>
						</tr>
					</table>			
				</td>
			</tr>
			<!--捞傈/促澜 傅农 冠胶 场-->
			<!-- 咯归 矫累 -->
			<tr height="2">
				<td></td>
			</tr>
			<!-- 咯归 场 -->
			<!-- 巩翠 府胶飘 矫累 -->
			<tr>
				<td>
					<table width="176" border="0" cellspacing="0" cellpadding="0" bgcolor="#f5f3e6">
						<%
			/*------------------------------------------------------------------------------------------------
			 *		柠令 top1狼 idx 啊廉坷促 
			 -------------------------------------------------------------------------------------------------*/
			query2 = "SELECT TOP 1 idx "+
					 " FROM GT_NsQuiz WITH (READUNCOMMITTED) "+
					 " WHERE phonenum = " + gphone + 
					 " ORDER BY regdate desc" ;
			pstmt = con.prepareStatement(query2);
			rs = pstmt.executeQuery();
			if(rs.next()){
				idx_top = rs.getInt(1);
			}	
			/*------------------------------------------------------------------------------------------------
			 *		柠令list 啊廉坷促 
			 -------------------------------------------------------------------------------------------------*/
			query3 = "SELECT idx,kind,title,takeIdx,reCnt,regdate "+
					 " FROM GT_NsQuiz WITH (READUNCOMMITTED) "+
					 " WHERE phonenum = " + gphone + 
					 " ORDER BY regdate desc" ;
			pstmt = con.prepareStatement(query3);
			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);
				kind = rs.getInt(2);
				title = rs.getString(3);
				upFlag = rs.getInt(4);
				reCnt = rs.getInt(5);
				date = rs.getString(6);
				bgcolor = "#f5f3e6";
			 %>
						<!-- 馆汗 1 矫累 -->
						<tr height="2">
							<td colspan="3"></td>
						</tr>

						<tr>
							<td width="3" bgcolor="<%=bgcolor%>"></td>
							<td bgcolor="<%=bgcolor%>">
								<input type="hidden" name="idx" value="<%=idx%>" />
								<input type="hidden" name="name" value="<%=name%>" />
								<input type="hidden" name="gphone" value="<%=gphone%>" />
								<font color="<%=mainFontColor%>"> 
								[<%=getType(kind)%>]
								</font>
								<a href="<%=url_path%>/news/myQuizView.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>&idx=<%=idx%>&name=<%=name%>&upFlag=<%=upFlag%>"><%=title%></a><font color="<%=mainFontColor%>"><b>[<%=reCnt%>]</b></font> 
								<br>
								&nbsp;
								<font color="#716e63" size="3">- <%=getTime(date)%> </font>
							</td>
							<td width="3" bgcolor="<%=bgcolor%>"></td>
						</tr>
						<tr height="2">
							<td colspan="3" bgcolor="<%=bgcolor%>"></td>
						</tr>

						<tr height="2">
							<td colspan="3" bgcolor="#ffffff"></td>
						</tr>

						<%
						if(rs.isLast())
								{ //盖 付瘤阜 饭内靛 老版快
									 break;
								}
								else
								{
									rs.next();
								}
						}
						 %>
					</table>
				</td>
			</tr>
			<!-- 巩翠 府胶飘 场 -->
			<!--其捞瘤 傅农 矫累-->
			<%
				String[] szSplit2 = pagePathBottom(pageurl, dbcount, pageNUM,pagecount);
			%>
			<tr>
				<td>			
					<table width="176" border="0" cellspacing="0" cellpadding="0" bgcolor="<%=pageBgColor %>">
						<tr>
							<td height="16">
								<table width="176" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td></td>
										<td width="21" align="center"><%=szSplit2[0]%><font color="#676767" size="3"><%=szSplit2[1]%></font><%=szSplit2[2]%></td>
								        <%
								        String pageColor = "";
								        for(int i=1;i<6;i++)
								        {
								         if(pageNUM%10 ==  Integer.parseInt(szSplit2[i*3+1]))
								          pageColor = pageFontColorY;
								         else
								          pageColor = pageFontColorN;
								       %>
								         <td width="1" align="center"><font color="<%=pageColor %>" size="3">|</font></td>
								         <td width="21" align="center"><%=szSplit2[i*3]%><font color="<%=pageColor%>" size="3"><b><%=szSplit2[i*3+1]%></b></font><%=szSplit2[i*3+2]%></td>
								       <%
								        }
								       %>
								        <td width="21" align="center"><%=szSplit2[18]%><font color="#676767" size="3"><%=szSplit2[19]%></font><%=szSplit2[20]%></td>
										<td></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>			
				</td>
			</tr>
			<!--其捞瘤 傅农 场-->
			<!--咯归 矫累-->
			<tr>
				<td height="6"></td>
			</tr>
			<!--咯归 场-->
			<!-- 滚瓢 矫累 -->
			<%if(mphone.equals(gphone)){%>
			<tr>
				<td>
					<table width="176" border="0" cellspacing="0" cellpadding="0">
						<tr height="16">
							<td></td>
							<td width="55" bgcolor="<%=mainBgColor%>" align="center">
								<a href="<%=url_path %>/news/myQuizAdd.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>&name=<%=name%>"><font color="#ffffff">货臂累己</font></a>
							</td>
							<td width="2"></td>
							<td width="55" bgcolor="<%=mainBgColor%>" align="center">
								<a href="<%=url_path%>/news/NewsMain.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>"><font color="#ffffff">倒酒啊扁</font></a>
							</td>
							<td></td>
						</tr>
					</table>
				</td>
			</tr>
			<%}else{%>
			<tr>
				<td>
					<table width="176" border="0" cellspacing="0" cellpadding="0">
						<tr height="16">
							<td></td>
							<td width="55" bgcolor="<%=mainBgColor%>" align="center">
								<a href="<%=url_path%>/news/NewsMain.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>"><font color="#ffffff">倒酒啊扁</font> </a>
							</td>
							<td></td>
						</tr>
					</table>
				</td>
			</tr>
			<%} %>
			<!-- 滚瓢 场 -->
			<!-- 咯归 矫累 -->
			<tr height="11">
				<td></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+"/news/NewsMain.jsp?mphone="+mphone+"&gphone="+gphone;
	%>
			<tr>
				<td>
					<table width="176" border="0" cellspacing="0" cellpadding="0">
						<tr height="15">
							<td width="8" bgcolor="#BBC7C8"></td>
							<td bgcolor="#DAE6E8">
								&nbsp;
								<a href="<%=step1%>">权</a>&gt;
								<a href="<%=step2%>"><%=name%>狼迄乔</a>&gt;
								<a href="<%=step3%>">春胶</a>&gt;柠令殿废
							</td>
							<td width="8" bgcolor="#BBC7C8"></td>
						</tr>
					</table>
				</td>
			</tr>
			<!--版肺钎矫 场-->
		</table>
		<%@ include file="../newbottom.jsp"%>
	</body>
</html>
<%
}
catch (Exception e) 
{
	System.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){}
}
%>
	<%!		 
		public String getType(int input)
		 {
		  if(input == 1)
		   return new String("郴秒氢");
		  if(input == 2)
		   return new String("郴厚剐");
		  if(input == 3)
		   return new String("郴己氢");
		  else
		   return new String("扁鸥");
		 }
		 
		 public String getTitle(String input,int type)
		 {
		  String strType = getType(type);
		  int typeLen = strType.length();
		  
		  StringBuffer sb = new StringBuffer();
		  int length = input.length();
		  if(length > 20 && length <= 40)
		   return input.substring(0,19-typeLen) + "<br>" + input.substring(20-typeLen,length);
		  if(length > 40 && length <= 60)
		   return input.substring(0,19-typeLen) + "<br>" + input.substring(20-typeLen,39-typeLen) + "<br>" + input.substring(39-typeLen+1,length);
		  return input;
		 }
	%>

⌨️ 快捷键说明

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