📄 infopressmate_g.jsp.svn-base
字号:
<!-------------------------------------------------------------
* @ name: infopressmate_g.jsp
* @ Author : ranxu
* @ date :2008-06-06
-------------------------------------------------------------->
<%@ page import='java.io.*,java.text.*,java.util.Date,java.util.*, 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"%>
<%
/*------------------------------------------------------------------------------------------------------
parameter from last page:knowmate_s.jap or knowmate_k.jap
-------------------------------------------------------------------------------------------------------*/
String hostNickname = java.net.URLDecoder.decode(makeKOR(request.getParameter("nickname")));
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
/*------------------------------------------------------------------------------------------------------
+ parameter of current page
-------------------------------------------------------------------------------------------------------*/
String guestNickname = "";
/*------------------------------------------------------------------------------------------------------
+ DB
-------------------------------------------------------------------------------------------------------*/
PreparedStatement pstmt = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String sql = null;
int ret = -1;
boolean haveDateOne = true;
boolean haveDate = true;
int point = 0;
try
{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%><%@ include file="../getConnection.jsp"%><%
/*------------------------------------------------------------------------------------------------
* All Quiz answerCount
-------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------
+ guestNickname
-------------------------------------------------------------------------------------------------------*/
//con = DBConnector.getConnection(db_name);
//if (con == null) {
// return;
//}
sql = " select nickname from gt_user_info WITH (READUNCOMMITTED) where phonenum='"+mphone+"'";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
if (rs.next()) {
guestNickname = rs.getString("nickname");
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
insert info of the guest who answered all questions
add by ranxu 2008-06-10
-------------------------------------------------------------------------------------------------*/
if(!guestNickname.equals("")){
sql = "insert into gt_lucky_request (phonenum,guest_phone,nickname) values (?,?,?)";
pstmt = con.prepareStatement(sql);
pstmt.setLong(1,Long.parseLong(gphone));
pstmt.setLong(2,Long.parseLong(mphone));
pstmt.setString(3,guestNickname);
ret = pstmt.executeUpdate();
if(ret==-1){
return;
}
pstmt.close();
}
String sqlsql = "SELECT * FROM GT_LUCK_POINT_DATE WHERE mphone = ? and gphone = ?";
pstmt = con.prepareStatement(sqlsql);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Long.parseLong(gphone));
rs=pstmt.executeQuery();
if(rs.next()){
}else{
haveDateOne = false;
}
rs.close();
pstmt.close();
if(haveDateOne){
sqlsql = "SELECT * FROM GT_LUCK_POINT_DATE WHERE mphone = ? and gphone = ? and left(send_point_date,10) > left(getdate()-2,10)";
pstmt = con.prepareStatement(sqlsql);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Long.parseLong(gphone));
rs=pstmt.executeQuery();
if(rs.next()){
haveDate = false;
}
rs.close();
pstmt.close();
if(haveDate){
sqlsql = "UPDATE GT_LUCK_POINT_DATE SET send_point_date = getdate() WHERE gphone = ? and mphone = ?";
pstmt = con.prepareStatement(sqlsql);
pstmt.setLong(1,Long.parseLong(gphone));
pstmt.setLong(2,Long.parseLong(mphone));
pstmt.executeUpdate();
pstmt.close();
}
}else{
sqlsql = "insert into gt_luck_point_date (mphone,gphone,send_point_date) values (?,?,getdate())";
pstmt = con.prepareStatement(sqlsql);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Long.parseLong(gphone));
pstmt.executeUpdate();
pstmt.close();
}
String sqlAttention = "SELECT Attention_point FROM GT_LUCKY_ATTENTION_POINT WHERE Guest_phone=" + Long.parseLong(mphone) + " and phonenum=" + Long.parseLong(gphone);
pstmt = con.prepareStatement(sqlAttention);
rs=pstmt.executeQuery();
while(rs.next())
{
point = rs.getInt("Attention_point");
}
rs.close();
pstmt.close();
if(haveDate){
if(point != 0)
{
point = point + 2;
String sqlUpdate = "UPDATE GT_LUCKY_ATTENTION_POINT set Attention_Point= ?,regdate = getdate() WHERE Guest_phone= ? and phonenum= ?";
pstmt = con.prepareStatement(sqlUpdate);
pstmt.setInt(1, point);
pstmt.setLong(2, Long.parseLong(mphone));
pstmt.setString(3, gphone);
pstmt.executeUpdate();
}
else
{
String sqlInsert = "INSERT INTO GT_LUCKY_ATTENTION_POINT (phonenum,Guest_phone,Attention_point,Attention_point_old,regdate) VALUES(?,?,1,0,getdate())";
pstmt = con.prepareStatement(sqlInsert);
pstmt.setLong(1, Long.parseLong(gphone));
pstmt.setLong(2, Long.parseLong(mphone));
pstmt.executeUpdate();
}
}
String txt = hostNickname+"丛捞 巩力甫 钱绢 焊扼绊 炼福绊 乐绢夸!";
String sqlSendMsg = "exec GT_SendMessage2_beta ?,?,?,?,?";
pstmt = con.prepareStatement(sqlSendMsg);
pstmt.setString(1, mphone);
pstmt.setString(2, gphone);
pstmt.setString(3, txt);
pstmt.setString(4, txt);
pstmt.setInt(5, 0);
pstmt.executeUpdate();
%>
<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>
-->
<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="#dae6e8"" 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="15"></td>
</tr>
<!--臂郴侩 矫累-->
<tr>
<td></td>
<td width="155" align="center"><font color="#9819e9"><%=hostNickname %></font>丛俊霸<br>
巩力甫 歹 钱绢 崔扼绊<br> 炼福扁甫 沁嚼聪促...<br><br>
<font color="#9819e9"><%=hostNickname %></font>丛捞 巩力甫 歹 钱搁<br>
率瘤肺 翠捞 坷霸 邓聪促.<br><br>
歹 巩力甫 钱霸 登搁 客辑<br>
促矫 犬牢甫 秦 焊技夸^^</td>
<td></td>
</tr>
<!--臂郴侩 场-->
<tr>
<td colspan="3" height="15"></td>
</tr>
</table>
</td>
<td width="3"></td>
</tr>
<tr>
<td colspan="3" height="3"></td>
</tr>
</table>
</td>
</tr>
<!--臂 冠胶 场-->
<tr>
<td height="3"></td>
</tr>
<!--滚瓢 矫累-->
<tr>
<td>
<table width="176" height="16" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td width="35" height="16" bgcolor="#bd7eff" align="center"><a href="<%=url_path%>/soulmate/soulmate_g.jsp?mphone=<%=mphone%>&gphone=<%=gphone %>"><font color="#ffffff">犬牢</font></a></td>
<td></td>
</tr>
</table>
</td>
</tr>
<!--滚瓢 场-->
<!--咯归 矫累-->
<tr>
<td height="11"></td>
</tr>
<!--咯归 场-->
<!--窍窜 版肺钎矫 矫累-->
<tr>
<td>
<table width="176" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" bgcolor="#BBC7C8"></td>
<td width="156" bgcolor="#DAE6E8" height="15"> <a href="<%=url_path+"/main.jsp?mphone="+mphone+"&gphone="+gphone%>">权</a>>
<a href="<%=url_path%>/mypage/my_confirm.jsp?mphone=<%=mphone%>&gphone=0<%=gphone%>"><%=hostNickname%>丛狼 迄乔</a></td>
<td width="10" bgcolor="#BBC7C8"></td>
</tr>
<tr>
<td width="10" bgcolor="#BBC7C8"></td>
<td width="156" bgcolor="#DAE6E8" height="15"> ><a href="<%=url_path%>/soulmate/soulmate_g.jsp?mphone=<%=mphone%>&gphone=<%=gphone %>">家匡皋捞飘</a>>炼福扁</td>
<td width="10" bgcolor="#BBC7C8"></td>
</tr>
</table>
</td>
</tr>
<!--窍窜 版肺钎矫 场-->
</table>
<!--窍窜 版肺钎矫 矫累-->
<%@ include file="../newbottom.jsp"%>
<!--窍窜 版肺钎矫 场-->
</body>
</html>
<%
}
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 + -