📄 gameguestbook_proc.jsp
字号:
<!--------------------------------------------------------------------------------------------------------------
*@霸烙皋牢
*@Author : zhou peng(2008-05-23)
--------------------------------------------------------------------------------------------------------------->
<%@ 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"%>
<scrpt>
<%
/**
*
*
* @ version : 1.0.0
* @ author : zhou peng ( pengzhou@isoftstone.com )
* @ last modified : 2008-05-23
*/
/*------------------------------------------------------------------------------------------------------
+ 扁夯 颇扼固磐
-------------------------------------------------------------------------------------------------------*/
String mphone= request.getParameter("mphone");
long mmphone = Long.parseLong(mphone);
String gphone= request.getParameter("gphone");
int gametype = Integer.parseInt(request.getParameter("gametype"));
String gamePlayType = java.net.URLDecoder.decode(makeKOR(request.getParameter("gamePlayType")));
int game_idx =Integer.parseInt(request.getParameter("game_idx"));
String name = java.net.URLDecoder.decode(makeKOR(request.getParameter("name")));
String guestbook = java.net.URLDecoder.decode(makeKOR(request.getParameter("guestbook")));
String game_title = java.net.URLDecoder.decode(makeKOR(request.getParameter("game_title")));
int matchtype = 0;
if(null != request.getParameter("matchtype")){
matchtype =Integer.parseInt(request.getParameter("matchtype"));
}
if(request.getParameter("guestbook") == ""){
String type = "0";
response.sendRedirect("./GameAlert.jsp?type="+type);
return;
}
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
String szCount = "";
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
Connection con = null;
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
/*------------------------------------------------------------------------------------------------
* insert message
-------------------------------------------------------------------------------------------------*/
szCount = " Insert into GT_GameGuestBookLog (phonenum,guest_phone,type,regdate) values(?,?,?,CONVERT(datetime,CONVERT(char(20),GETDATE(),110)))" ;
pstmt = con.prepareStatement(szCount);
pstmt.setString(1,mphone);
pstmt.setString(2,gphone);
pstmt.setInt(3,gametype);
pstmt.executeUpdate();
pstmt.close();
if(gametype == 1)
{
/*------------------------------------------------------------------------------------------------
* insert Me and Opponent
-------------------------------------------------------------------------------------------------*/
szCount = " Insert into GT_GameMatch (game_idx,phonenum,guest_phone,winFlag,type,regdate) values(?,?,?,?,?,CONVERT(datetime,CONVERT(char(20),GETDATE(),110)))" ;
pstmt = con.prepareStatement(szCount);
pstmt.setInt(1,game_idx);
pstmt.setString(2,mphone);
pstmt.setString(3,gphone);
pstmt.setInt(4,0);
pstmt.setInt(5,matchtype);
pstmt.executeUpdate();
pstmt.close();
}
else
{
szCount ="insert into GT_guestbook (phonenum,nickname,guestbook_face,guestbook_date,guestbook_text,guest_phone,guest_title,read_flag,lastdate) "+
" values(?,?,1,CONVERT(datetime,CONVERT(char(20),GETDATE(),110)),?,?,?,0,CONVERT(datetime,CONVERT(char(20),GETDATE(),110)))";
pstmt = con.prepareStatement(szCount);
pstmt.setString(1,gphone);
pstmt.setString(2,name);
pstmt.setString(3,guestbook);
pstmt.setString(4,mphone);
pstmt.setString(5,game_title);
pstmt.executeUpdate();
pstmt.close();
}
response.sendRedirect("game_start.jsp?game_idx="+game_idx+"&mphone="+mphone+"&gphone="+gphone+"&gamePlayType="+gamePlayType);
}
catch(Exception e)
{
throw e;
}
finally
{
if ( rs != null ) { try { rs.close(); } catch ( Exception e ) { } }
if ( stmt != null ) { try { stmt.close(); } catch ( Exception e ) { } }
if ( con != null ) { try { con.close(); } catch ( Exception e ) { } }
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -