⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 messageadding.jsp

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 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"%>
	
 <%
	String mphone = request.getParameter("mphone");
	String gphone = request.getParameter("gphone");
	String friendNum = request.getParameter("friendNum");
	String idx = request.getParameter("idx");
	String message = request.getParameter("message");
	String friendNickName =	java.net.URLDecoder.decode(makeKOR(request.getParameter("friendNickName")));
	String name = java.net.URLDecoder.decode(makeKOR(request.getParameter("name")));
	/*------------------------------------------------------------------------------------------------------
	+	DB 包访 函荐
	-------------------------------------------------------------------------------------------------------*/	
	
	Connection con = null;
	PreparedStatement pstmt=null;
	Statement stmt = null;
	ResultSet rs = null;
	ResultSet pageset = null;

	
	
	/*------------------------------------------------------------------------------------------------------
	+	傈开 函荐
	-------------------------------------------------------------------------------------------------------*/
	
		String query1 = null,query2 = null,query3 = null, sql = null;
		//String name = null;
		int id = 0;
		int Attention_point = 0;
		int Update_point = 0;
	
	try
	{
	%><%@ include file="../getConnection.jsp"%><%
	
	/*------------------------------------------------------------------------------------------------
	 *		
	 -------------------------------------------------------------------------------------------------*/
	
	query2 ="SELECT  idx  as  id  FROM GT_LUCKY_ATTENTION_POINT "+
			" where phonenum = "+friendNum +"  and Guest_phone = " + mphone;
			
	pstmt = con.prepareStatement(query2);
	rs = pstmt.executeQuery();
	if(rs.next()){
		id = rs.getInt(1);
	}	
	
	if(id != 0){
	query3 = "SELECT  Attention_point  FROM GT_LUCKY_ATTENTION_POINT "+
			 "  where idx = "+ id;	
	pstmt = con.prepareStatement(query3);
	rs = pstmt.executeQuery();
	if(rs.next()){
		Attention_point = rs.getInt(1);
	}
	
	}	
			
	/*------------------------------------------------------------------------------------------------
	 *		急琶篮  龙巩阑  眠啊    
	 -------------------------------------------------------------------------------------------------*/
	 if(id == 0){
	 
		 query1 ="INSERT INTO GT_guestbook "+
			    "( phonenum, nickname, guestbook_face,guestbook_date, "+
				" guestbook_text, guest_phone, guest_title, read_flag,lastdate) "+
				" VALUES("+friendNum+",'"+friendNickName+"',2,getdate(),?,"+mphone+",'',0,"+
				"getdate() )";
		query1 = query1 +"INSERT INTO GT_LUCKY_ATTENTION_POINT  "+
				 "(phonenum, Guest_phone, Attention_point, Attention_point_old)"+
				 " VALUES("+friendNum+","+mphone+",1,0)";
		
	}else{
		Update_point = Attention_point + 1;
		 query1 ="INSERT INTO GT_guestbook "+
			    "( phonenum, nickname, guestbook_face,guestbook_date, "+
				" guestbook_text, guest_phone, guest_title, read_flag,lastdate) "+
				" VALUES("+friendNum+",'"+friendNickName+"',2,getdate(),?,"+mphone+",'',0,"+
				"getdate() )";	
		query1 = query1 +" UPDATE  GT_LUCKY_ATTENTION_POINT  " +
				 " SET  Attention_point= "+ Update_point+", Attention_point_old="+Attention_point+", regdate= getdate()"+
				 " WHERE idx =" + id;		
	}		
		pstmt = con.prepareStatement(query1);
		pstmt.setString(1,message);
		pstmt.executeUpdate();
		pstmt.close();
	if(message == ""){
		response.sendRedirect("messageWarn.jsp?mphone="+mphone+"&gphone="+gphone+"&name="+name);
	}else{
		response.sendRedirect("/mypage/my_main_sub.jsp?mphone="+mphone+"&gphone="+friendNum+"&hostf=Y");
	}
	}

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 + -