📄 myquizmodifing.jsp
字号:
<%@ 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>
<%
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 idx = request.getParameter("idx");
String name = java.net.URLDecoder.decode(makeKOR(request.getParameter("name")));
String text = java.net.URLDecoder.decode(makeKOR(request.getParameter("text")));
String title = java.net.URLDecoder.decode(makeKOR(request.getParameter("title")));
String kind = request.getParameter("kind");
/*------------------------------------------------------------------------------------------------------
+ DB 包访 函荐
-------------------------------------------------------------------------------------------------------*/
Connection con = null;
PreparedStatement pstmt=null;
Statement stmt = null;
ResultSet rs = null;
ResultSet pageset = null;
/*------------------------------------------------------------------------------------------------------
+ 傈开 函荐
-------------------------------------------------------------------------------------------------------*/
String query1 = null, sql = null;
int upFlag =0;
int re_idx = 0;
try
{
%>
<%@ include file="../getConnection.jsp"%>
<% if(kind .equals("0")||text.getBytes().length>800||title.getBytes().length>60||text.trim().length() == 0||title.trim().length() == 0){
response.sendRedirect("myQuizAddError.jsp?mphone="+mphone+"&gphone="+gphone+"&name="+name);
} else{%>
<%
/*-------------------------------------------------------------------------------------------------
* 盲琶 咯何
--------------------------------------------------------------------------------------------------*/
query1 ="SELECT takeIdx FROM GT_NsQuiz WITH (READUNCOMMITTED) WHERE idx="+idx ;
pstmt =con.prepareStatement(query1);
rs = pstmt.executeQuery();
if(rs.next()){
re_idx = rs.getInt(1);
}
rs.close();
pstmt.close();
if(re_idx == 0){upFlag = 0 ;}else{upFlag = 1;}
/*-------------------------------------------------------------------------------------------------
* 货 柠令甫 涝仿
--------------------------------------------------------------------------------------------------*/
if(title.equals("")||text.equals("")||kind .equals("0")||title.getBytes().length>60||text.getBytes().length>800||text.trim().length() == 0){
response.sendRedirect("myQuizAddError.jsp?mphone="+mphone+"&gphone="+gphone+"&name="+name);
}else{
sql = "UPDATE GT_NsQuiz SET kind=?, title=?, text=? WHERE idx="+idx ;
pstmt = con.prepareStatement(sql);
pstmt.setString(1,kind);
pstmt.setString(2,title);
pstmt.setString(3,text);
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 + -