📄 quizview_zp.jsp.svn-base
字号:
<!--------------------------------------------------------------------------------------------------------------
*@霸烙皋牢
*@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;
String title = null;
int answer = 0;
// 其捞瘤 备泅 眠啊 函荐
int pagesize = 3; // 茄其捞瘤寸 10俺 免仿拱
// 傈开 函荐肺 急攫.. 其捞瘤 备泅 何盒俊 犁荤侩
int pageNUM = 1; // 其捞瘤 锅龋
int pagecount = 1 ; // 其捞瘤 肮荐 瘤沥 函荐
int absolutepage = 1; // 例措 困摹 其捞瘤 锅龋
int dbcount = 0; // DB 救俊 臂 肮荐 历厘 函荐
int isNoPage = 0; //茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
String szCount = null;
String pageurl = null;
String regdate = null;
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
Connection con = null;
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
ResultSet pageset = null;
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
/*------------------------------------------------------------------------------------------------
* All Quiz answerCount
-------------------------------------------------------------------------------------------------*/
sql = " select count(distinct(guest_phone)) answerCount from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum="+Long.parseLong(mphone) ;
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if( rs.next() )
{
answerCount = rs.getInt("answerCount");
}else{
answerCount = 0;
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* My Question Count
-------------------------------------------------------------------------------------------------*/
sql = " select count(distinct(quiz_idx)) questionCount from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum="+Long.parseLong(mphone) +"and guest_phone="+Long.parseLong(mphone);
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if( rs.next() )
{
questionCount = rs.getInt("questionCount");
}else{
questionCount = 0;
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* 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();
/*------------------------------------------------------------------------------------------------
* Quiz opponent's Right answercount
-------------------------------------------------------------------------------------------------*/
sql = " select count(*) oppRightCount 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)+" and c.guest_phone =" ;
sql = sql + "(select top 1 guest_phone from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum="+Long.parseLong(mphone)+" order by regdate desc)" ;
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if( rs.next() )
{
oppRightCount = rs.getInt("oppRightCount");
}else{
oppCount = 0;
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* Quiz opponent's answercount
-------------------------------------------------------------------------------------------------*/
sql = " select count(distinct a.idx)oppCount from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED) where a.phonenum ="+Long.parseLong(mphone)+" and a.guest_phone =" ;
sql = sql + "(select top 1 guest_phone from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum="+Long.parseLong(mphone)+" order by regdate desc)" ;
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if( rs.next() )
{
oppCount = rs.getInt("oppCount");
}else{
oppCount = 0;
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* Quiz opponent's attentionPoint
-------------------------------------------------------------------------------------------------*/
sql = " select nickname,sex,(substring(convert(varchar(8),getDate(),112),0,5)-year) age,attention_point ";
sql = sql +" from Gt_user_info a WITH (READUNCOMMITTED), gt_lucky_attention_point b WITH (READUNCOMMITTED) where a.phonenum=b.phonenum and a.phonenum='"+mphone+"' and b.guest_phone =";
sql = sql + "(select top 1 guest_phone from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum="+Long.parseLong(mphone)+" and guest_phone != "+Long.parseLong(mphone)+" order by regdate desc)" ;
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next()){
attentionPoint = rs.getInt("attention_point");
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* Quiz opponent's Info
-------------------------------------------------------------------------------------------------*/
sql = " select top 1 a.nickname,a.sex,a.year,(substring(convert(varchar(8),getDate(),112),0,5)-a.year+1) age ,a.phonenum, b.regdate from GT_User_Info a WITH (READUNCOMMITTED), GT_LUCKY_QUIZ_MYLOG b WITH (READUNCOMMITTED) WHERE b. phonenum='"+mphone+"' and a.phonenum = b.guest_phone and a.phonenum=" ;
sql = sql + "(select top 1 c.guest_phone from GT_LUCKY_QUIZ_MYLOG c WITH (READUNCOMMITTED) where c.guest_phone="+Long.parseLong(gphone)+" order by c.regdate desc)" ;
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if( rs.next() )
{
strOppNickname = rs.getString("nickname");
sex = rs.getInt("sex");
age = rs.getInt("age");
strGuestphone = rs.getString("phonenum");
regdate = rs.getString("regdate");
}else{
strOppNickname = "绝澜";
sex = 1;
age = 0;
strGuestphone = "";
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* pageCount
-------------------------------------------------------------------------------------------------*/
szCount = " select count(*) quizCount from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum="+Long.parseLong(mphone)+" and guest_phone="+Long.parseLong(gphone);
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;
}
/*------------------------------------------------------------------------------------------------
* QuizListLog
-------------------------------------------------------------------------------------------------*/
szCount = " select title,answer from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum="+Long.parseLong(mphone)+" and guest_phone="+Long.parseLong(gphone)+" order by regdate desc ";
pstmt = con.prepareStatement(szCount);
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>
<!--剧侥
<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" bgcolor="#ecaaff" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height="3"></td>
</tr>
<tr>
<td width="3"></td>
<td>
<!--鸥捞撇 矫累-->
<table width="170" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height="5"></td>
</tr>
<tr>
<td colspan="3" align="center"><font color="#9819e9"><b>滴辟 滴辟 龙巩 措翠!</b></font></td>
</tr>
<!--备盒扼牢 矫累-->
<tr>
<td width="5"></td>
<td align="center"><font color="#cccccc">··························</font></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -