?? myqamatchmate.jsp.svn-base
字號:
<!--
*@目敲霸烙 婁茫扁
*@Author : 彌眠巋 (2008-6-06)
*@Images : 其撈瘤 救俊 甸絹啊綽 撈固瘤
1) bg_01.png - 拋撈喉 彌惑竄 硅版撈固瘤(仟弗禍)
-->
<%@ page import='java.io.*,java.text.*,java.util.Date,java.util.Vector, javax.servlet.http.HttpSession,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"%>
<%
/***********************************************************************
@ Page Description
霸烙 皋牢 其撈瘤
@ Parameter
***********************************************************************/
/*------------------------------------------------------------------------------------------------------
+ 扁夯 頗扼固磐
-------------------------------------------------------------------------------------------------------*/
String mphone= request.getParameter("mphone");
String gphone= request.getParameter("gphone");
String name= java.net.URLDecoder.decode(makeKOR(request.getParameter("name")));
String panduan= request.getParameter("panduan");
String ox[] = new String[5];
String qa[] = new String[5];
String qidx[]=new String [5];
/*------------------------------------------------------------------------------------------------------
+ 傈開 函薦
-------------------------------------------------------------------------------------------------------*/
long Guest_phone = 0;
int Attention_point = 0;
String nickname = "";
String dianhua = "";
int sex =0;
int year =0;
int nyear =0;
int age =0;
int Match_point = 0;
double answercount =0.0;
int cont1 =0;
double allcont =0.0;
int starAttentionfull =0;
int starAttentionemp = 0;
int starMatchfull =0;
int starMatchemp =0;
double percent =0;
String[] title =new String[5];
String[] quizidx = new String[5];
int flag =0;
int idx = 0;
/*------------------------------------------------------------------------------------------------------
+ DB 包訪 函薦
-------------------------------------------------------------------------------------------------------*/
PreparedStatement pstmt = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String query1 = null;
String riqi = null;
int intRiqi = 0;
Date regdater = new Date();
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
riqi = sf.format(regdater);
intRiqi = Integer.parseInt(riqi.replace("-",""));
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池記
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
/*------------------------------------------------------------------------------------------------
*
-------------------------------------------------------------------------------------------------*/
for(int i=0;i<5;i++)
{
if(request.getParameter("ox"+i)!=null){
ox[i]=request.getParameter("ox"+i);
qa[i] = makeKOR(request.getParameter("qa"+i));
qidx[i] = request.getParameter("qidx"+i);
query1="insert into GT_LUCKY_QUIZ_MYLOG (Quiz_idx,title,answer,phonenum,Guest_phone,regdate,nregdate)"+
"values(?,?,?,?,?,?,?)";
pstmt= con.prepareStatement(query1);
pstmt.setInt(1,Integer.parseInt(qidx[i]));
pstmt.setString(2,qa[i]);
pstmt.setInt(3,Integer.parseInt(ox[i]));
pstmt.setLong(4,Long.parseLong(mphone));
pstmt.setLong(5,Long.parseLong(mphone));
pstmt.setString(6,riqi);
pstmt.setInt(7,intRiqi);
pstmt.executeUpdate();
pstmt.close();
}
}
/*------------------------------------------------------------------------------------------------
* 唱客 嘎綽 葷恩
-------------------------------------------------------------------------------------------------*/
query1 = "select top 1 Guest_phone,Attention_point from GT_LUCKY_ATTENTION_POINT WITH (READUNCOMMITTED) where Guest_phone in("+
" select distinct Guest_phone from gt_lucky_quiz_mylog WITH (READUNCOMMITTED) where phonenum =? and Guest_phone != ?) "+" order by Attention_point desc";
pstmt = con.prepareStatement(query1);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Long.parseLong(mphone));
rs = pstmt.executeQuery();
if(rs.next())
{
Guest_phone = rs.getLong("Guest_phone");
Attention_point = rs.getInt("Attention_point");
}
starAttentionfull = Attention_point/4;
starAttentionemp = (Attention_point%4)/2;
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* 唱客 嘎綽 葷恩狼 扁夯 瀝焊
-------------------------------------------------------------------------------------------------*/
query1="select nickname,sex,year,phonenum from gt_user_info WITH (READUNCOMMITTED) where phonenum = '0"+Guest_phone+"'";
pstmt = con.prepareStatement(query1);
rs = pstmt.executeQuery();
if(rs.next())
{
nickname = rs.getString("nickname");
sex = rs.getInt("sex");
year = rs.getInt("year");
dianhua = rs.getString("phonenum");
}
rs.close();
pstmt.close();
Calendar calendar=Calendar.getInstance();
nyear=calendar.get(Calendar.YEAR);
age = nyear-year;
/*------------------------------------------------------------------------------------------------
* 唱客 嘎綽 葷恩狼 概莫檔
-------------------------------------------------------------------------------------------------*/
query1="select Match_point from GT_LUCKY_MATCH_POINT WITH (READUNCOMMITTED) where phonenum =? and Guest_phone = ?";
pstmt = con.prepareStatement(query1);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Guest_phone);
rs = pstmt.executeQuery();
if(rs.next())
{
Match_point = rs.getInt("Match_point");
}
starMatchfull = ((Match_point*24)/4)/100;
starMatchemp = (((Match_point*24)%4)/2)/100;
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* 唱客 嘎綽 葷恩 瀝翠 薦
-------------------------------------------------------------------------------------------------*/
query1 = " select count(a.idx) answercount from gt_lucky_quiz_mylog a WITH (READUNCOMMITTED),gt_lucky_quiz_mylog c WITH (READUNCOMMITTED)"+
" where a.quiz_idx=c.quiz_idx and a.answer = c.answer"+
" and a.phonenum =? and a.guest_phone =?"+
" and c.phonenum =?"+" and c.guest_phone =?";
pstmt = con.prepareStatement(query1);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Guest_phone);
pstmt.setLong(3,Long.parseLong(mphone));
pstmt.setLong(4,Long.parseLong(mphone));
rs = pstmt.executeQuery();
if(rs.next())
{
answercount = rs.getInt("answercount");
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* 唱客 嘎綽 葷恩 翠函 薦
-------------------------------------------------------------------------------------------------*/
query1="select count(idx) as allcont from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum =? and Guest_phone =? ";
pstmt = con.prepareStatement(query1);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Guest_phone);
rs = pstmt.executeQuery();
if(rs.next())
{
allcont = rs.getInt("allcont");
}
percent = (answercount/allcont) * 100;
if(percent > 100){
percent = 100;
}
/*------------------------------------------------------------------------------------------------
* 唱客 嘎綽 葷恩 薦
-------------------------------------------------------------------------------------------------*/
query1="select count(distinct Guest_phone)as cont1 from gt_lucky_quiz_mylog WITH (READUNCOMMITTED) where phonenum =? and guest_phone != ?";
pstmt = con.prepareStatement(query1);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Long.parseLong(mphone));
rs = pstmt.executeQuery();
if(rs.next())
{
cont1 = rs.getInt("cont1");
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* 錢絹焊瘤 臼籃 鞏力
-------------------------------------------------------------------------------------------------*/
//query1 = "select distinct top 5 a.title,a.idx from GT_LUCKY_QUIZ a,GT_LUCKY_QUIZ_MYLOG b where a.idx = b.Quiz_idx"+
// " and a.flag = 1 and b.Quiz_idx not in(select quiz_idx from GT_LUCKY_QUIZ_MYLOG where Guest_phone =?)"+
// " order by a.idx desc";
query1 = "select distinct top 5 title,idx from GT_LUCKY_QUIZ WITH (READUNCOMMITTED) where flag = 1 and idx not in(select quiz_idx from GT_LUCKY_QUIZ_MYLOG WITH (READUNCOMMITTED) where phonenum = ? and Guest_phone = ?) order by idx desc";
pstmt = con.prepareStatement(query1);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Long.parseLong(mphone));
rs = pstmt.executeQuery();
for(int i=0;rs.next();i++)
{
title[i] = rs.getString("title");
quizidx[i] = rs.getString("idx");
flag = i+1;
}
rs.close();
pstmt.close();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link href="../mobile.css" rel="stylesheet" type="text/css" />
<title>權 > <%=name %>叢狼 迄喬包府 > 家匡皋撈飄 > 龍鞏措翠</title>
</head>
<body>
<form name="form1" action="<%=url_path%>/soulmate/MYQAmatchMate.jsp" method="post" >
<input type="hidden" name="name" value="<%=name%>" />
<input type="hidden" name="mphone" value="<%=mphone%>" />
<input type="hidden" name="gphone" value="<%=gphone%>" />
<input type="hidden" name="panduan" value="<%=panduan%>" />
<%if(flag!=0){for(int i=0;i<flag;i++){ %>
<input type="hidden" name="qidx<%=i %>" value="<%=quizidx[i]%>" />
<input type="hidden" name="qa<%=i %>" value="<%=title[i]%>" />
<%}} %>
<table width="240" border="0" cellspacing="0" cellpadding="0">
<!--鷗撈撇 矯累-->
<tr>
<td>
<table width="240" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" height="2" bgcolor="#c789ff"></td>
</tr>
<tr>
<td width="10" height="15" bgcolor="#9819e9"></td>
<td height="15" bgcolor="#9819e9">
<font color="#ffffff">
<%if(panduan.equals("1")){ %>
龍鞏措翠 搬苞焊扁
<%}else{ %>
龍鞏措翠 錢絹焊扁
<%} %>
</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="8"></td>
</tr>
<!--咯歸 場-->
<%if(nickname!=""){%>
<!--唱客 嘎綽 葷恩甸 冠膠 矯累-->
<tr>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -