📄 myquizansweradding.jsp.svn-base
字号:
<%@ 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="formatUtil.jsp"%>
<%@ include file="../makeKOR.jsp"%>
<style type="text/css">
A:hover {
COLOR: #000000; TEXT-DECORATION: underline
}
A:link {
COLOR: #000000; TEXT-DECORATION: underline
}
A:visited {
COLOR: #000000; TEXT-DECORATION: underline
}
</style>
<%!
public String getTime(){
Calendar now=Calendar.getInstance();
String time=now.get(Calendar.YEAR)+"-"+
(now.get(Calendar.MONTH)+1)+"-"+
now.get(Calendar.DAY_OF_MONTH)+" "+
now.get(Calendar.HOUR_OF_DAY)+":"+
now.get(Calendar.MINUTE)+":"+
now.get(Calendar.SECOND);
return time;
}
%>
<%
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));
String re_text = java.net.URLDecoder.decode(makeKOR(request.getParameter("re_text")));
String idx = request.getParameter("idx");
String name = java.net.URLDecoder.decode(makeKOR(request.getParameter("name")));
String upFlag = request.getParameter("upFlag");
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
Connection con = null;
PreparedStatement pstmt=null;
Statement stmt = null;
ResultSet rs = null;
ResultSet pageset = null;
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
String query1 = null, sql = null,query2=null;
String re_name =null;
try
{
%>
<%@ include file="../getConnection.jsp"%>
<%
/*------------------------------------------------------------------------------------------------------
+ 瘩臂 茄 荤恩狼 nickname
-------------------------------------------------------------------------------------------------------*/
sql="SELECT nickname FROM GT_user_info WITH (READUNCOMMITTED) WHERE phonenum = convert(bigint,"+ mphone+")";
pstmt = con.prepareStatement(sql);
rs =pstmt.executeQuery();
if(rs.next()){
re_name = rs.getString(1);
}
rs.close();
pstmt.close();
/*------------------------------------------------------------------------------------------------
* 瘩臂荐 刘啊
-------------------------------------------------------------------------------------------------*/
query2 = "UPDATE GT_NsQuiz SET reCnt = reCnt +"+1+" WHERE idx="+idx;
pstmt = con.prepareStatement(query2);
pstmt.executeUpdate();
pstmt.close();
if(re_text.getBytes().length>800||re_text.trim().length() == 0){
response.sendRedirect("myQuizAddError.jsp?mphone="+mphone+"&gphone="+gphone+"&name="+name);
}else{
query1 = "INSERT INTO GT_NsQuizRe(phonenum, nickname, text, ref_idx, takeFlag,regdate)"+
"VALUES(convert(bigint,"+mphone+"),?,?,?,0,?)";
pstmt = con.prepareStatement(query1);
pstmt.setString(1,re_name);
pstmt.setString(2,re_text);
pstmt.setString(3,idx);
pstmt.setString(4,getTime());
pstmt.executeUpdate();
pstmt.close();
response.sendRedirect("myQuizView.jsp?mphone="+mphone+"&gphone="+gphone+"&idx="+idx+"&name="+name+"&upFlag="+upFlag);
}
}
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 + -