📄 taroforfunction_lhl.jsp
字号:
<%@ page language="java" pageEncoding="EUC-KR"%>
<%@ page import="java.io.*,java.text.*,java.util.Date,java.util.Vector, java.sql.*, com.entaz.lib.db.*, com.entaz.relay.net.* "%>
<%@ include file="../imgpath.jsp"%>
<%@ include file="../common_func.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<%!
public String getdate()
{
java.text.SimpleDateFormat formatter_f = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date currentTime_f = new java.util.Date();
String new_date_f = formatter_f.format(currentTime_f);
System.out.println("121212121212 getdate()=" + new_date_f);
return new_date_f;
}
%>
<%
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
String taroId = request.getParameter("taroID");
String falseUrl = "taroforfailedanswer_lhl.jsp?mphone="+mphone+"&gphone="+gphone+"&taroID="+taroId;
String txt = request.getParameter("text");
if(txt == null|| "".equals(txt.trim())){
txt = " ";
}else{
txt = java.net.URLDecoder.decode(makeKOR(txt));
}
boolean haveDateOne = true;
boolean haveDate = true;
int taro_idx = Integer.parseInt(request.getParameter("taro_idx"));
String username = "No name";
if(txt.getBytes().length < 8){
request.getRequestDispatcher(falseUrl).forward(request,response);
//response.sendRedirect(falseUrl);
}else
{
Connection con = null;
PreparedStatement pstmt = null;
Statement stmt = null;
ResultSet rs = null;
ResultSet pageset = null;
String tableGT_USER_INFO = "GT_USER_INFO";
String tableGT_LUCKY_ATTENTION_POINT = "GT_LUCKY_ATTENTION_POINT";
String tableGT_LUCKY_TARO_COMMENT = "GT_LUCKY_TARO_COMMENT";
String tableGT_LUCKY_TARO = "GT_LUCKY_TARO";
try {
%>
<%@ include file="../getConnection.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>12权 > Xxx丛狼 迄乔 > 家匡皋捞飘 > 鸥肺痢</title>
<link rel="stylesheet" href="../mobile.css" type="text/css"></link>
</head>
<body>
<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>
<%
String sqlName = "SELECT nickname FROM " + tableGT_USER_INFO + " WITH (READUNCOMMITTED) WHERE phonenum='" + gphone + "'";
stmt = con.createStatement();
rs = stmt.executeQuery(sqlName);
while(rs.next())
{
username = rs.getString("nickname");
}
long lMphone = Long.parseLong(mphone);
long iGphone = Long.parseLong(gphone);
int point = 0;
String sqlAttention = "SELECT Attention_point FROM " + tableGT_LUCKY_ATTENTION_POINT + " WITH (READUNCOMMITTED) WHERE Guest_phone=" + lMphone + " and phonenum=" + iGphone;
//System.out.println("=====1212121212 sqlAttention=" + sqlAttention);
rs = stmt.executeQuery(sqlAttention);
while(rs.next())
{
point = rs.getInt("Attention_point");
}
String sql = "SELECT * FROM GT_LUCK_POINT_DATE WITH (READUNCOMMITTED) WHERE mphone = ? and gphone = ?";
pstmt = con.prepareStatement(sql);
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){
sql = "SELECT * FROM GT_LUCK_POINT_DATE WITH (READUNCOMMITTED) WHERE mphone = ? and gphone = ? and left(trao_point_date,10) > left(getdate()-2,10)";
pstmt = con.prepareStatement(sql);
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){
sql = "UPDATE GT_LUCK_POINT_DATE SET trao_point_date = getdate() WHERE gphone = ? and mphone = ?";
pstmt = con.prepareStatement(sql);
pstmt.setLong(1,Long.parseLong(gphone));
pstmt.setLong(2,Long.parseLong(mphone));
pstmt.executeUpdate();
pstmt.close();
}
}else{
sql = "insert into gt_luck_point_date (mphone,gphone,trao_point_date) values (?,?,getdate())";
pstmt = con.prepareStatement(sql);
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setLong(2,Long.parseLong(gphone));
pstmt.executeUpdate();
pstmt.close();
}
if(haveDate){
if(point != 0)
{
point = point + 1;
String sqlUpdate = "UPDATE " + tableGT_LUCKY_ATTENTION_POINT + " set Attention_Point= ?,regdate=? WHERE Guest_phone= ? and phonenum= ?";
pstmt = con.prepareStatement(sqlUpdate);
pstmt.setInt(1, point);
pstmt.setString(2, getdate());
pstmt.setLong(3, Long.parseLong(mphone));
pstmt.setString(4, gphone);
pstmt.executeUpdate();
}
else
{
String sqlInsert = "INSERT INTO " + tableGT_LUCKY_ATTENTION_POINT + " VALUES(?,?,1,0,?)";
pstmt = con.prepareStatement(sqlInsert);
pstmt.setLong(1, Long.parseLong(gphone));
pstmt.setLong(2, Long.parseLong(mphone));
pstmt.setString(3, getdate());
pstmt.executeUpdate();
}
}
int resultT = 0;
String sqlInsertText = "INSERT INTO " + tableGT_LUCKY_TARO_COMMENT + " VALUES(?,?,?,?,?)";
pstmt = con.prepareStatement(sqlInsertText);
pstmt.setInt(1, taro_idx);
pstmt.setInt(2, Integer.parseInt(taroId));
pstmt.setString(3, mphone);
pstmt.setString(4, txt);
pstmt.setString(5, getdate());
pstmt.executeUpdate();
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);
resultT = pstmt.executeUpdate();
if(resultT != 0)
{
String sqlUpdateComment = "UPDATE " + tableGT_LUCKY_TARO + " SET comment=1 WHERE idx IN(" +
"SELECT TOP 1 a.idx " +
"FROM " + tableGT_LUCKY_TARO + " a WITH (READUNCOMMITTED), " + tableGT_LUCKY_TARO_COMMENT + " b WITH (READUNCOMMITTED)" +
"WHERE a.comment=0 and a.idx=b.taro_idx and a.phonenum='" + gphone + "' and b.phonenum=convert(bigint,'" + mphone + "') ORDER BY a.idx Desc)";
pstmt = con.prepareStatement(sqlUpdateComment);
pstmt.executeUpdate();
}
pstmt.close();
rs.close();
stmt.close();
con.close();
}
catch(Exception e) {
e.printStackTrace();
}
}
%>
<!--臂郴侩 矫累-->
<tr>
<td></td>
<td width="220" align="center"><font color="#9819e9"><%= username %></font>丛俊霸<br>
鸥肺痢阑 毫 靛啡嚼聪促.<br><br>
<font color="#909090" size="3">鸥肺痢 搬苞绰 <%= username %>丛俊霸 率瘤肺 惯价登菌嚼聪促.<br>
郴啊 惯价茄 鸥肺痢 钱捞 郴侩阑 犬牢窍角 荐 乐绢夸~^^</font></td>
<td></td>
</tr>
<!--臂郴侩 场-->
<tr>
<td colspan="3" height="15"></td>
</tr>
</table>
</td>
<td width="3"></td>
</tr>
<tr>
<td colspan="3" height="15"></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="taroforview_lhl.jsp?mphone=<%=mphone%>&gphone=<%=gphone %>&taroID=<%=taroId%>&taro_idx=<%=taro_idx%>"><font color="#ffffff">犬牢</font></a></td>
<td></td>
</tr>
</table>
</td>
</tr>
<!--滚瓢 场-->
<!--咯归 矫累-->
<tr>
<td height="11"></td>
</tr>
<!--咯归 场-->
<%
String step1=url_path+"/main.jsp?mphone="+mphone+"&gphone="+gphone;//权
String step2=url_path+"/mypage/my_confirm.jsp?mphone="+mphone+"&gphone="+gphone;
String step3=url_path+"/soulmate/soulmate_g.jsp?mphone="+mphone+"&gphone="+gphone;
%>
<!--窍窜 版肺钎矫 矫累-->
<tr>
<td>
<table width="176" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" bgcolor="#BBC7C8"></td>
<td width="156" bgcolor="#DAE6E8" height="19"> <a href="<%= step1 %>">权</a>><a href="<%= step2 %>"><%=username%>丛狼 迄乔</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="<%= step3 %>">家匡皋捞飘</a>> 鸥肺痢</td>
<td width="10" bgcolor="#BBC7C8"></td>
</tr>
</table>
</td>
</tr>
<!--窍窜 版肺钎矫 场-->
</table>
<!--窍窜 版肺钎矫 矫累-->
<%@ include file="../newbottom.jsp"%>
<!--窍窜 版肺钎矫 场-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -