edit1.jsp
上传用户:apbaoyuan
上传日期:2021-02-12
资源大小:1015k
文件大小:2k
- <%@page import="java.sql.*"%>
- <%@page import="java.util.*"%>
- <%@page contentType="text/html;charset=GB2312"%>
- <%@include file="opendata.jsp"%>
- <%@include file="convert.jsp"%>
- <%@include file="check.jsp"%>
- <html>
- <head>
- <title>
- 编辑问题及选项
- </title>
- <link href="style.css" rel=stylesheet>
- <body>
- <center>
- 为了保证投票的公正性,请先将计数器清零后修改选项!
- </center>
- <hr>
- <form action=modify.jsp method=post>
- <DIV align=center>
- <TABLE cellSpacing=0 cellPadding=0 width=73% align=center border=0 bordercolor="#999999">
- <tr>
- <td bgcolor=#999999>调查主题:</td>
- <%
- try{
- request.setCharacterEncoding("GB2312");
- request.getSession(true);
- session.putValue("questionid",String.valueOf(request.getParameter("questionid")));
- int questionid;
- questionid = Integer.parseInt(request.getParameter("questionid"));
- out.print("<a href=resetcount.jsp?questionid="+questionid+"><font color=red>将本主题投票记数全部清0</font></a>");
- sql = "select Question from Questions where QuestionID='"+questionid+"'";
- rs = smt.executeQuery(sql);
- String question = null;
- while(rs.next())
- {
- question = rs.getString(1);
- // question = Replace(question);
- }
- %>
- <td align=right><input class=smallInput type=text size=90 name=question value = "<%=question%>"></td>
- <%sql = "select Item from Items where QuestionID='"+questionid+"'";
- rs = smt.executeQuery(sql);
- String item = null;
- int i= 0;
- while(rs.next())
- {
- item = rs.getString(1);
- i++;
- out.print("<tr><td>选项"+i+":</td>");
- %>
- <td align=right><input class=smallInput type=text size=90 name=item<%=String.valueOf(i)%> value="<%=item%>"></td></tr>
- <%}
- rs.close();
- smt.close();
- con.close();
- for(;i<10;++i)
- {
- out.print("<tr><td>选项"+(i+1)+":</td>");
- out.print("<td align=right><input class=smallInput type=text size=90 name=item"+String.valueOf(i+1)+" ></td></tr>");
- }
-
- }
- catch (Exception e) {
- e.getStackTrace();
- }
- %>
- <tr><td>
- </tr>
- </table>
- </DIV>
- <p>
- <DIV align=center><INPUT class=buttonface type=submit value=发布 name=Submit>
- <INPUT class=buttonface type=reset value=重写 name=Submit2></DIV>
- </form>
- <hr>
- <div align="center"><a href = mainform.jsp>回问卷管理页面</a></div>
- </body>
- </html>