mainform.jsp
上传用户:apbaoyuan
上传日期:2021-02-12
资源大小:1015k
文件大小:5k
源码类别:

Jsp/Servlet

开发平台:

HTML/CSS

  1. <%@page contentType="text/html;charset=GB2312"%>
  2. <%@page import="java.sql.*"%>
  3. <%@include file="opendata.jsp"%>
  4. <%@include file="check.jsp"%>
  5. <html>
  6. <head>
  7. <title>问卷管理</title>
  8. <LINK href="style.css" rel=stylesheet>
  9. </head>
  10. <body background="qq2.jpg">
  11. <center>
  12. <%
  13.    request.setCharacterEncoding("GB2312");
  14. %>
  15. <div align=center><font color=red>管理员可以发布新问题,撤消正在发布的主题,修改、删除已经被撤消的主题。</font></div>
  16. <%! String modifyid ;%>
  17. <table  width=60% >
  18.   <tbody>
  19.   <tr>
  20.     <td colSpan=2>
  21.           <div align=center>正在被投票的主题</div>
  22.     </td>
  23.   </tr>
  24.   <tr>
  25.     <td colSpan=2>
  26.       <table cellSpacing=0 cellPadding=0 width=100% align=center border=1 bordercolor="#999999">
  27.         <tbody>
  28.             <tr>
  29.               <td width="18%">
  30.                 <div align="center">发布时间</div>
  31.               </td>
  32.               <td width="55%" >
  33.                 <div align="center">主题</div>
  34.               </td>
  35.               <td width="13%">
  36.                 <div align="center">撤消|恢复</div>
  37.               </td>
  38.               <td width="14%">
  39.                 <div align="center">是否公布结果</div>
  40.               </td>
  41.               
  42.             </tr>
  43. <%
  44. try{
  45. request.setCharacterEncoding("GB2312");
  46.  sql = "select * from questions where IsVisable=1";
  47.  rs = smt.executeQuery(sql);
  48.  String question,date;
  49.  int isvisable;
  50.  int questionid ;
  51.  int id = 0;
  52.  int isopen = 0;
  53.  while(rs.next())
  54.  {
  55.   questionid = rs.getInt(1);
  56.   question = rs.getString(2);
  57.   isvisable = rs.getInt(3);
  58.   date = rs.getString(4);
  59.   isopen = rs.getInt(5);
  60.   out.print("<tr>");
  61.   out.print("<td align=center>"+date+"</td>");
  62.   out.print("<td ><a href=result.jsp?questionid="+questionid+" target = _blank>"+question+"</a></td>");
  63.   out.print("<td align=center><a href=isvisable.jsp?questionid="+questionid+">撤消</a></td>");
  64.   if (isopen == 1)
  65.   out.print("<td align=center><a href=isopen.jsp?questionid="+questionid+">隐藏结果</a></td>");
  66.   else
  67.   out.print("<td align=center><a href=isopen.jsp?questionid="+questionid+">公布结果</a></td>");
  68.   out.print("</tr>");
  69.  }
  70.  
  71. %>
  72.         </tbody>
  73.       </table>
  74.     </td>
  75.   </tr>
  76. </table>
  77. <p>
  78. <p>
  79. <div align=center><font color=red>管理员需要重新编辑投票主题,请先将该主题撤消,暂停被投票。新发布或是刚被修改的投票主题需要确认“恢复”才能被发布。</red></div>
  80. <p>
  81. <p>
  82. <table  width=60%>
  83.   <tbody>
  84.   <tr>
  85.     <td colSpan=2>
  86.           <div align=center>已经撤消或者尚未发布的主题</div>
  87.     </td>
  88.   </tr>
  89.   <tr>
  90.     <td colSpan=2>
  91.       <table cellSpacing=0 cellPadding=0 width=100% align=center border=1 bordercolor="#999999">
  92.         <tbody>
  93.             <tr>
  94.               <td width="18%">
  95.                 <div align="center">发布时间</div>
  96.               </td>
  97.               <td width="55%">
  98.                 <div align="center">主题</div>
  99.               </td>
  100.               <td width="9%">
  101.                 <div align="center">撤消|恢复</div>
  102.               </TD>
  103.               <TD width="9%">
  104.                 <div align="center">重新编辑</div>
  105.               </TD>
  106.               <TD width="9%">
  107.                 <div align="center">永久删除 </div>
  108.               </TD>
  109.             </TR>
  110. <%request.setCharacterEncoding("GB2312");
  111.  sql = "select * from questions where IsVisable=0";
  112.  rs = smt.executeQuery(sql);
  113.  String _question,_date;
  114.  int _questionid,_isvisable,_id=0;
  115.  while(rs.next())
  116.  {
  117.   _questionid = rs.getInt(1);
  118.   _question = rs.getString(2);
  119.   _isvisable = rs.getInt(3);
  120.   _date = rs.getString(4);
  121.   _id++;
  122.   //_quetionid = String.valueOf(_questionid);
  123.   out.print("<tr>");
  124.   out.print("<td align=center>"+_date+"</td>");
  125.   out.print("<td><a href=result.jsp?questionid="+_questionid+" target = _blank>"+_question+"</a></td>");
  126.   out.print("<td align=center><a href=isvisable.jsp?questionid="+_questionid+">恢复</a></td>");
  127.   out.print("<td align=center><a href=edit.jsp?questionid="+_questionid+"><u>添加</u></a><br><a href=edit1.jsp?questionid="+_questionid+"><u>发布</u></a></td>");
  128.   out.print("<td align=center><a href=delete.jsp?questionid="+_questionid+">删除</a></td>");
  129.   out.print("</tr>");
  130.  }
  131.  rs.close();
  132.  smt.close();
  133.  con.close();
  134.  } catch (Exception e) {
  135. e.getStackTrace();
  136. %>
  137.         </TBODY>
  138.       </TABLE>
  139.     </TD>
  140.   </TR>
  141. </table>
  142. <p>
  143. <p>
  144. <hr>
  145. <TD align=middle>
  146.    <div align="center"> <b>
  147.    <a href=showresult.jsp target = _blank><font  size=5  color=green>查看所有主题投票统计</font> </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  148.     <a href=addpoll.jsp> <font  size=5  color=green>发布新问题</font> </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  149.     <a href=member.jsp> <font  size=5  color=green>用户管理</font></a></b></div>
  150. </TD>
  151. <center>
  152. </body>
  153. </html>