📄 game_yourspage.jsp.svn-base
字号:
<!-- ***********************************************************************************************
*@权>XXX丛 迄乔>霸烙
*@Author : 弥篮柳(2008-05-16)
*@Images : 其捞瘤 救俊 甸绢啊绰 捞固瘤 : 乐澜
************************************************************************************************ -->
<%@ 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"%>
<%
/***********************************************************************
@ Page Description
阿 霸烙 其捞瘤(老馆,目敲,模备)
@ Parameter
***********************************************************************/
/*------------------------------------------------------------------------------------------------------
+ 扁夯 颇扼固磐
-------------------------------------------------------------------------------------------------------*/
String vmtype = request.getParameter("vmtype") == null ? "":request.getParameter("vmtype").substring(0,1);
String vGameTableName = null;
if(vmtype.equals("b")){ vGameTableName = "GT_game_brew"; }else{ vGameTableName = "GT_game_wipi"; }
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
String showlink = request.getParameter("showlink");
if(mphone.equals(gphone))
{
response.sendRedirect(url_path+"/ranking/GameMy.jsp?mphone="+mphone+"&gphone="+gphone);
return;
}
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
int game_idx=0;
String nickname = null;
String mynickname=null;
int sex = 0;
String couplephone = null;
String couplenickname = null;
int couplesex=0;
String nickname_man=null;
String nickname_woman=null;
String YourStrname = "";
int score=0;
int couplerank=0;
int aFlag=0;
int challengeFlag=0;
String couplegametitle=null;
String gametext=null;
String gameimgpath=null;
String challengeGame_title[]=new String[6];
int challengeGame_idx[]=new int[6];
int challengeFailnum=0;
int challengeWinnum=0;
int sumChallengeFail=0;
int sumChallengeWin=0;
int ranknum=0;
int upranknum=0;
int sumpoint=0;
int upsumpoint=0;
int goldnum=0;
int silvernum=0;
int coppernum=0;
String gameResultDate[]=new String[5];
String gameResultName[]=new String[5];
String gameResultRank[]=new String[5];
String frompagename=null;
int nidx = -1;
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
PreparedStatement pstmt = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
Statement stmt2 = null;
ResultSet rs2 = null;
ResultSet pageset = null;// 其捞瘤 备泅 眠啊 函荐 ---------
String query1 = null;
String query2 = null;
/*------------------------------------------------------------------------------------------------------
+ 其捞瘤 备泅 眠啊 函荐
-------------------------------------------------------------------------------------------------------*/
int pagesize = 4; // 茄其捞瘤寸 10俺 免仿拱
int pageNUM=1; // 其捞瘤 锅龋
int pagecount=1 ; // 其捞瘤 肮荐 瘤沥 函荐
int absolutepage=0; // 例措 困摹 其捞瘤 锅龋
int dbcount=0 ; // DB 救俊 臂 肮荐 历厘 函荐
int isNoPage = 0; //茄俺档 绝蠢衬.. 绝栏搁0, 乐栏搁1
try
{
//=========================== 傍烹函券累诀 : 2008-01-21 ===========================
/**
* 公丰霸烙鸥款 矫胶袍痢八 棺 喉发蜡历 八免
*
* @ date ?8-01-21
* @ version 1.2.0
*/
// DB 楷搬捞 登瘤 臼阑 锭, 救郴芒栏肺 捞悼
//
%>
<%@ include file="../getConnection.jsp"%>
<%
//=========================== 傍烹函券累诀 : 2008-01-21 ===========================
stmt = con.createStatement();
query1 = "select nickname,sex from GT_user_info where phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
YourStrname = rs.getString("nickname");
}
rs.close();
/**************************************
couple game
***************************************/
query1 = "select nickname,sex from GT_user_info where phonenum = '"+mphone+"'";
rs=stmt.executeQuery(query1);
if(!rs.next())
{
response.sendRedirect(url_path+"/user_info/regist_notice.jsp?mphone="+mphone+"&gphone="+gphone);
return;
}
else
{
mynickname = rs.getString("nickname");
sex = rs.getInt("sex");
}
rs.close();
query1 = "select nickname,sex from GT_user_info where phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(!rs.next())
{
response.sendRedirect(url_path+"/user_info/regist_notice.jsp?mphone="+mphone+"&gphone="+gphone);
return;
}
else
{
nickname = rs.getString("nickname");
couplesex = rs.getInt("sex");
}
rs.close();
if(sex==couplesex)
{
aFlag=1;
}else{
query1 = "select nickname_man, nickname_woman,(gamescore_man+gamescore_woman) score from GT_gamecouple where phonenum_man = '"+gphone+"' or phonenum_woman = '"+gphone+"'";
rs=stmt.executeQuery(query1);
//out.println(query1);
if(!rs.next())
{
// mynickname = rs.getString(1);
// mycouplenickname = rs.getString(2);
// myscore = rs.getInt(3);
aFlag = 1;
}
else
{
nickname_man = rs.getString("nickname_man");
nickname_woman = rs.getString("nickname_woman");
score=rs.getInt("score");
}
rs.close();
query1 = " select count(*) cnt from GT_gamecouple where (gamescore_man+gamescore_woman)>= "+score;
rs=stmt.executeQuery(query1);
if(rs.next())
{
couplerank=rs.getInt("cnt");
}
rs.close();
}
/**************************************
couple game title
***************************************/
query1 = " select game_idx,game_title,game_text,game_img_path from GT_game where game_couple = 1 ";
rs=stmt.executeQuery(query1);
if(rs.next())
{
game_idx=rs.getInt("game_idx");
couplegametitle=rs.getString("game_title");
gametext=rs.getString("game_text");
gameimgpath=rs.getString("game_img_path");
}
rs.close();
/*------------------------------------------------------------------------------------------------
* 富巢扁扁 魄窜
-------------------------------------------------------------------------------------------------*/
query1="select idx from GT_GameGuestBookLog where guest_phone=? and phonenum =? ";
pstmt = con.prepareStatement(query1);
pstmt.setLong(1,Long.parseLong(gphone));
pstmt.setLong(2,Long.parseLong(mphone));
rs = pstmt.executeQuery();
if(rs.next())
{
nidx = rs.getInt("idx");
}
rs.close();
pstmt.close();
/**************************************
challenge flag
***************************************/
query1 = "select game_idx from GT_gamematch where phonenum = '"+gphone+"' or guest_phone = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(!rs.next())
{
challengeFlag = 1;
}
rs.close();
/**************************************
challenge gameinfo
***************************************/
query1 = " select game_title ,game_idx from GT_gameplay_info a, GT_game b where (a.play_first=b.game_idx or a.play_second=b.game_idx or a.play_third=b.game_idx or a.play_4=b.game_idx or a.play_5=b.game_idx or a.play_6=b.game_idx) and a.phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
int i=0;
while(rs.next())
{
challengeGame_title[i]=rs.getString("game_title");
challengeGame_idx[i]=rs.getInt("game_idx");
//System.out.println("challengegame "+i+" is :"+challengeGame_title[i]);
i++;
}
rs.close();
/**************************************
challenge game fail number today
***************************************/
query1 = " select count(*) cnt from gt_gamematch where winflag=0 and regdate=CONVERT(varchar(30),getdate(),102) and phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
challengeFailnum=rs.getInt("cnt");
}
rs.close();
/**************************************
challenge game win number today
***************************************/
query1 = " select count(*) cnt from gt_gamematch where winflag=1 and regdate=CONVERT(varchar(30),getdate(),102) and phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
challengeWinnum=rs.getInt("cnt");
}
rs.close();
/**************************************
challenge game fail number in all
***************************************/
query1 = " select count(*) cnt from gt_gamematch where winflag=0 and phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
sumChallengeFail=rs.getInt("cnt");
}
rs.close();
/**************************************
challenge game win number in all
***************************************/
query1 = " select count(*) cnt from gt_gamematch where winflag=1 and phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
sumChallengeWin=rs.getInt("cnt");
}
rs.close();
/**************************************
game piont in all
***************************************/
query1 = " select point,point-point_old uppoint from gt_gameranking where phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
sumpoint=rs.getInt("point");
upsumpoint=rs.getInt("uppoint");
}
rs.close();
/**************************************
game rank in all
***************************************/
query1 = " select count(*) ranknum from gt_gameranking where point>= "+sumpoint;
rs=stmt.executeQuery(query1);
if(rs.next())
{
ranknum=rs.getInt("ranknum");
}
rs.close();
/**************************************
game uprank in all
***************************************/
query1 = " select raking_old from gt_gameranking where phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
int rank_old=rs.getInt("raking_old");
upranknum=ranknum-rank_old;
}
rs.close();
/**************************************
game uprank in all
***************************************/
query1 = " select No1,No2,No3 from gt_gamechampion where phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
goldnum=rs.getInt("No1");
silvernum=rs.getInt("No2");
coppernum=rs.getInt("No3");
}
rs.close();
/**************************************
game result list
***************************************/
query1 = " select top 5 convert(varchar(20),regdate,111) regdate ,game_title,win from gt_gamechampionlog a, gt_game b where a.game_idx=b.game_idx and a.phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
int j=0;
while(rs.next())
{
gameResultDate[j]=rs.getString("regdate");
gameResultName[j]=rs.getString("game_title");
gameResultRank[j]=rs.getString("win");
j++;
}
rs.close();
/**************************************
from page
***************************************/
query1 = " select name from GT_user_info where phonenum = '"+gphone+"'";
rs=stmt.executeQuery(query1);
if(rs.next())
{
frompagename=rs.getString("name");
}
rs.close();
}
catch (Exception e)
{
//out.println(e);
out.println(e);
throw e;
}
finally
{
if(rs != null) try{rs.close();}catch(Exception se){}
if(pageset != null) try{pageset.close();}catch(Exception se){}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -