📄 answerrepleaction.jsp.svn-base
字号:
<!-------------------------------------------------------------
* @ name: answerRepleAction.jsp
* @ Author : linaZhou
* @ date :2008-06-27
-------------------------------------------------------------->
<%@ 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="formatUtil.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<%!
public static String isNull(String str){
if (str == null)
return "";
else
return str;
}
%>
<%
/*------------------------------------------------------------------------------------------------------
+ 扁夯 颇扼固磐
-------------------------------------------------------------------------------------------------------*/
String mphone = request.getParameter("mphone");
String gphone = request.getParameter("gphone");
if(mphone == null){
mphone= "09900100081";
}
if(gphone == null){
gphone = mphone;
}
mphone = getStrPhone(getLong(mphone));
gphone = getStrPhone(getLong(gphone));
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
int stickerType = 0;
int ref_idx = 0;
String redirectPage = "";
String repleContent = "";
String visit_nickname = "";
stickerType = Integer.parseInt(request.getParameter("stickerType"));
ref_idx = Integer.parseInt(request.getParameter("idx"));
repleContent = java.net.URLDecoder.decode(makeKOR(request.getParameter("repleContent")));
if(repleContent.getBytes().length>800){
redirectPage="aRepleAddError.jsp?mphone="+mphone+"&gphone="+gphone;
}else{
if(repleContent == null || repleContent.trim().equals("")){
redirectPage="answerRepleAddError.jsp?mphone="+mphone+"&gphone="+gphone+"&idx="+ref_idx;
}else{
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
PreparedStatement pstmt = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String query1 = null;
String sql = null;
int ret = -1;
/*------------------------------------------------------------------------------------------------------
+ 朝楼 包访
-------------------------------------------------------------------------------------------------------*/
Timestamp di_date = null;
Date today = new Date();
SimpleDateFormat timeform;
timeform = new SimpleDateFormat("MM/dd HH:mm");
try{
/*------------------------------------------------------------------------------------------------
* DB 目池记
-------------------------------------------------------------------------------------------------*/
%>
<%@ include file="../getConnection.jsp"%>
<%
/*------------------------------------------------------------------------------------------------
* 款技屏.
-------------------------------------------------------------------------------------------------*/
query1 = " SELECT nickname FROM GT_user_Info WITH (READUNCOMMITTED) WHERE phonenum = CONVERT( bigint,'"+mphone+"')";
pstmt = con.prepareStatement(query1);
rs = pstmt.executeQuery();
if(rs.next()){
visit_nickname = rs.getString("nickname");
}
rs.close();
pstmt.close();
/**************************************
胶鸥客 嘎苗焊绰 矾宏款技!
***************************************/
stmt = con.createStatement();
query1=" INSERT INTO GT_Ns30questionRe (phonenum,nickname,text,sticker,ref_idx,regdate)"+
" VALUES (?,?,?,?,?,getdate())";
pstmt = con.prepareStatement(query1);
int index = 4;
pstmt.setLong(1,Long.parseLong(mphone));
pstmt.setString(2,visit_nickname);
pstmt.setString(3,repleContent);
pstmt.setInt(4,stickerType);
pstmt.setInt(5,ref_idx);
ret = pstmt.executeUpdate();
if(ret==-1){
return;
}else{
redirectPage = "30q&a_repleList.jsp?mphone="+mphone+"&gphone="+gphone+"&idx="+ref_idx;
}
pstmt.close();
/**************************************
胶鸥客 嘎苗焊绰 矾宏款技!
***************************************/
stmt = con.createStatement();
query1=" UPDATE GT_Ns30question SET reCnt = reCnt+1 WHERE idx ="+ref_idx;
pstmt = con.prepareStatement(query1);
pstmt.executeUpdate();
pstmt.close();
}catch(Exception e){
System.out.println(e);
}finally{
if(rs != null) try{ rs.close(); }catch(Exception se){}
if(pstmt != null) try{ pstmt.close(); }catch(Exception se){}
if(stmt != null) try{ stmt.close(); }catch(Exception se){}
if(con != null) try{ con.close(); }catch(Exception se){}
}
}
}
response.sendRedirect(redirectPage);
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -