📄 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"%>
<%
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
String taroId = request.getParameter("taroID");
String txt = request.getParameter("text");
int taro_idx = Integer.parseInt(request.getParameter("taro_idx"));
String username = "No name";
String falseUrl = "taroforfailedanswer_lhl.jsp?mphone=" + mphone + "&gphone=" + gphone + "&taroID=" + taroId;
if(txt.length() < 4)
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 {
//aaa
%>
<%@ 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="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">鸥肺痢 毫林扁</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>
<!--咯归 场-->
<!--臂 冠胶 矫累-->
<tr>
<td>
<table width="240" bgcolor="#dae6e8"" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height="3"></td>
</tr>
<tr>
<td width="3"></td>
<td>
<table width="234" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height="20"></td>
</tr>
<%
String sqlName = "SELECT name FROM " + tableGT_USER_INFO + " WHERE phonenum='" + gphone + "'";
stmt = con.createStatement();
rs = stmt.executeQuery(sqlName);
while(rs.next())
{
System.out.println("=====1212121212 username=" + rs.getString("name"));
username = rs.getString("name");
}
long lMphone = Long.parseLong(mphone);
long iGphone = Long.parseLong(gphone);
int point = 0;
String sqlAttention = "SELECT Attention_point FROM " + tableGT_LUCKY_ATTENTION_POINT + " 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");
}
if(point != 0)
{
point = point + 1;
System.out.println("1212121212=====not null=====point=" + point);
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
{
System.out.println("121212121212===== null null null 11111=====");
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_SendMessage ?,?,?,?";
pstmt = con.prepareStatement(sqlSendMsg);
pstmt.setLong(1, Long.parseLong(mphone));
pstmt.setLong(2, Long.parseLong(gphone));
pstmt.setString(3, "");
pstmt.setString(4, txt);
resultT = pstmt.executeUpdate();
System.out.println("======12 12 12 12 resultT=" + resultT);
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, " + tableGT_LUCKY_TARO_COMMENT + " b " +
"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)";
System.out.println("=====12121212121212 sqlUpdateComment=" + sqlUpdateComment);
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">鸥肺痢 搬苞绰 酒捞叼咯几磊丛俊霸<br>
率瘤肺 惯价捞 登绢辑<br>
鸥肺痢 搬苞甫 父电 巴阑 犬牢 且 荐 乐绢夸.</font></td>
<td></td>
</tr>
<!--臂郴侩 场-->
<tr>
<td colspan="3" height="20"></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="240" height="17" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td width="40" height="17" 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="79"></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="240" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" bgcolor="#BBC7C8"></td>
<td width="220" bgcolor="#DAE6E8" height="19"> <a href="<%= step1 %>">权</a>><a href="<%= step2 %>"><%=username%>丛狼 迄乔</a>><a href="<%= step3 %>">家匡皋捞飘</a>> 鸥肺痢</td>
<td width="10" bgcolor="#BBC7C8"></td>
</tr>
</table>
</td>
</tr>
<!--窍窜 版肺钎矫 场-->
</table>
<!--窍窜 版肺钎矫 矫累-->
<%@ include file="../newbottom.jsp"%>
<!--窍窜 版肺钎矫 场-->
</body>
</html>
<%!
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;
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -