📄 knowmate_s.jsp.svn-base
字号:
<!-------------------------------------------------------------
* @ name: knowmate_s.jsp
* @ Author : ranxu
* @ date :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"%>
<%@ include file="../makeKOR.jsp"%>
<%!
int SEX_MALE = 1;
int SEX_FEMALE = 2;
public String getSex(int key)
{
String ret = "";
if(key==SEX_FEMALE){
ret = "巢己";
}else if(key==SEX_MALE){
ret = "咯己";
}
return ret;
}
%>
<%
/*------------------------------------------------------------------------------------------------------
parameter from last page:soulmate_main.jap
-------------------------------------------------------------------------------------------------------*/
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
/*------------------------------------------------------------------------------------------------------
+ DB
-------------------------------------------------------------------------------------------------------*/
PreparedStatement pstmt = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String sql = null;
int ret = -1;
/*------------------------------------------------------------------------------------------------------
+ parameter of current page
-------------------------------------------------------------------------------------------------------*/
int quiz_idx =0;
String title = "";
int hostAnswer = 0;
int nregdate = 0;
String regdate = "";
double allCount = 0.0;
double answeredCount = 0.0;
double answeredRightCount = 0.0;
int unansweredCount = 0;
List unansweredIdxs = null;
List unansweredTitles = null;
List hostAnswers = null;
int matchPoint =0;
int knowPoint =0;
String riqi = null;
int intRiqi = 0;
String nickname = "";
String nicknameface = "";
String nicknamefaceTwo = "";
int age = 0;
int sex = 0;
int attentionPoint = 0;
Date regdater = new Date();
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
riqi = sf.format(regdater);
intRiqi = Integer.parseInt(riqi.replace("-",""));
boolean haveDate = true;
boolean haveDateOne = true;
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
/**************************************
胶鸥客 嘎苗焊绰 矾宏款技!
***************************************/
/*-------------------------------------------------------------------------------------------------------
host's info
-------------------------------------------------------------------------------------------------------*/
sql = " select nickname from Gt_user_info WITH (READUNCOMMITTED) where phonenum=?";
pstmt = con.prepareStatement(sql);
pstmt.setString(1,gphone);
rs=pstmt.executeQuery();
if(rs.next()){
nicknameface = rs.getString("nickname");
}
rs.close();
pstmt.close();
sql = " select nickname from Gt_user_info WITH (READUNCOMMITTED) where phonenum=?";
pstmt = con.prepareStatement(sql);
pstmt.setString(1,mphone);
rs=pstmt.executeQuery();
if(rs.next()){
nicknamefaceTwo = rs.getString("nickname");
}
rs.close();
pstmt.close();
sql = " select nickname,sex,(substring(convert(varchar(8),getDate(),112),0,5)-year+1) age,attention_point "
+" from Gt_user_info a WITH (READUNCOMMITTED), gt_lucky_attention_point b WITH (READUNCOMMITTED) where a.phonenum=b.phonenum and a.phonenum=?";//'"+gphone+"'";
pstmt = con.prepareStatement(sql);
pstmt.setString(1,gphone);
rs=pstmt.executeQuery();
if(rs.next()){
nickname = rs.getString("nickname");
sex = rs.getInt("sex");
age = rs.getInt("age");
attentionPoint = rs.getInt("attention_point");
}
rs.close();
pstmt.close();
/*-------------------------------------------------------------------------------------------------------
get the count of guest unanswered title
-------------------------------------------------------------------------------------------------------*/
sql = " select count(a.idx) answeredcount from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED),gt_lucky_quiz b WITH (READUNCOMMITTED)"+
" where a.quiz_idx = b.idx and b.flag=1 "+
" and a.phonenum =? and a.guest_phone=?"+
" and a.quiz_idx not in"+
" (select distinct a.quiz_idx from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED),gt_lucky_quiz b WITH (READUNCOMMITTED)"+
" where a.quiz_idx = b.idx and b.flag=1 "+
" and a.phonenum =? and a.guest_phone =? )";
pstmt = con.prepareStatement(sql);
pstmt.setLong(1,Long.parseLong(gphone));
pstmt.setLong(2,Long.parseLong(gphone));
pstmt.setLong(3,Long.parseLong(gphone));
pstmt.setLong(4,Long.parseLong(mphone));
rs=pstmt.executeQuery();
if(rs.next()){
unansweredCount = rs.getInt("answeredcount");
}
rs.close();
pstmt.close();
/*-------------------------------------------------------------------------------------------------------
get the unanswered title
-------------------------------------------------------------------------------------------------------*/
unansweredTitles = new ArrayList();
hostAnswers = new ArrayList();
unansweredIdxs = new ArrayList();
sql = " select top 5 a.* from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED),gt_lucky_quiz b WITH (READUNCOMMITTED)"+
" where a.quiz_idx = b.idx and b.flag=1 "+
" and a.phonenum =? and a.guest_phone=? "+
" and a.quiz_idx not in "+
" (select distinct a.quiz_idx from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED),gt_lucky_quiz b WITH (READUNCOMMITTED)"+
" where a.quiz_idx = b.idx and b.flag=1 "+
" and a.phonenum =? and a.guest_phone =? "+
" )order by a.idx desc";
pstmt = con.prepareStatement(sql);
pstmt.setLong(1,Long.parseLong(gphone));
pstmt.setLong(2,Long.parseLong(gphone));
pstmt.setLong(3,Long.parseLong(gphone));
pstmt.setLong(4,Long.parseLong(mphone));
rs=pstmt.executeQuery();
while(rs.next()){
unansweredIdxs.add(rs.getString("quiz_idx"));
unansweredTitles.add(rs.getString("title"));
hostAnswers.add(rs.getString("answer"));
}
rs.close();
pstmt.close();
%>
<html>
<head>
<link href="http://entaz.mugeta.com/client/mugeta_v2_test/web/user/mobile.css" rel="stylesheet" type="text/css">
<title>权> 酒捞叼咯几磊丛俊 措秦 舅扁</title>
</head>
<body>
<!--剧侥
<tr>
<td>
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
-->
<form name="form1" action="knowmate_k.jsp" method="post">
<input type="hidden" name="mphone" value="<%=mphone%>">
<input type="hidden" name="gphone" value="<%=gphone%>">
<input type="hidden" name="nickname" value="<%=java.net.URLEncoder.encode(nickname)%>">
<input type="hidden" name="status" value="insertMulti">
<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"><%=nickname %>丛俊 措秦 舅扁</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>
<!--咯归 场-->
<!--咯归 矫累-->
<!--咯归 场-->
<%
if(unansweredCount == 0){
%>
<!--家匡皋捞飘 冠胶1 矫累-->
<tr>
<td >
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5"></td>
<td width="166">
<table width="166" border="0" cellspacing="0" cellpadding="0">
<tr>
<!--酒官鸥 矫累-->
<td width="54">
<table width="54" bgcolor="#e8f2f2" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height="3"></td>
</tr>
<tr>
<td width="3"></td>
<td valign="top"><img src="<%=ava_path%>display_thumb.jsp?mphone=<%=mphone%>&gphone=<%=gphone%>" width="48" height="54"></td>
<td width="3"></td>
</tr>
<tr>
<td colspan="3" height="3"></td>
</tr>
</table>
</td>
<!--酒官鸥 场-->
<!--郴侩 矫累-->
<td width="112">
<table width="112" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="2"></td>
<td width="110" valign="top"><b><%=nicknameface%></b><br><font color="#909090"><%=getSex(sex) %> (<%=age %>)</font></td>
<td></td>
</tr>
<tr>
<td width="5"></td>
<td colspan="2"><font color="#909090"><%=nicknameface%>丛俊 措茄<br>包缴档 </font>
<font color="#ffa6d6"><%
if(attentionPoint>=24){
%>
<%=nicknameface %>丛阑 亮酒窍绊 乐绢夸~
<%
}else if(attentionPoint>=20 && attentionPoint<=23){
%>
<%=nicknameface %>丛俊霸 包缴捞 乐绢夸~
<%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -