errorpad_addrate.jsp
上传用户:nbluoke
上传日期:2013-08-09
资源大小:4851k
文件大小:3k
源码类别:

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
  2. <%@ page import="jinghua.*"%>
  3. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  4. </jsp:useBean>
  5. <%!boolean debug=true;
  6. %>
  7. <%
  8. String strPage=request.getParameter("OnPage");
  9. String errorpad_grade=request.getParameter("Grade");
  10. String errorpad_sub=request.getParameter("Subject");
  11. String errorpad_knowpoint=request.getParameter("KnowPoint");
  12. String errorpad_testtype=request.getParameter("testtype");
  13. String errorpad_errorcount=request.getParameter("errorcount");
  14. if(debug){
  15.     out.print("<br>grade="+errorpad_grade+
  16.     "<br>sub="+errorpad_sub+
  17.     "<br>knowpoint="+errorpad_knowpoint+
  18.     "<br>testtype="+errorpad_testtype+
  19.     "<br>errorcunt="+errorpad_errorcount);
  20. }
  21. if(errorpad_grade!=null)
  22. {
  23.     session.setAttribute("errorpad_grade",errorpad_grade);
  24. }
  25. else
  26. {
  27.     errorpad_grade=(String)session.getAttribute("errorpad_grade");
  28. }
  29. if(errorpad_sub!=null)
  30. {
  31.     session.setAttribute("errorpad_sub",errorpad_sub);
  32. }else
  33. {
  34.     errorpad_sub=(String)session.getAttribute("errorpad_sub");
  35. }
  36. if(errorpad_knowpoint!=null)
  37. {
  38.     session.setAttribute("errorpad_knowpoint",errorpad_knowpoint);
  39. }
  40. else
  41. {
  42.     errorpad_knowpoint=(String)session.getAttribute("errorpad_knowpoint");
  43. }
  44. if(errorpad_testtype!=null)
  45. {
  46.     session.setAttribute("errorpad_testtype",errorpad_testtype);
  47. }
  48. else
  49. {
  50.     errorpad_testtype=(String)session.getAttribute("errorpad_testtype");
  51. }
  52. if(errorpad_errorcount!=null)
  53. {
  54.     session.setAttribute("errorpad_errorcount",errorpad_errorcount);
  55. }
  56. else
  57. {
  58.     errorpad_errorcount=(String)session.getAttribute("errorpad_errorcount");
  59. }
  60. String [] ids=request.getParameterValues("id");
  61. if(ids==null){
  62.      Tools.showalert("请您选择欲删除的知识点!",out);
  63.     Tools.goback(out);
  64. }else
  65. {
  66. String sql;
  67. StringBuffer sb=new StringBuffer();
  68. for(int i=0;i<ids.length;i++){
  69.     sb.append(ids[i]+",");
  70. }
  71. sql=sb.toString().substring(0,sb.length()-1);
  72. sql="update errorpad set errorcount=errorcount+1 where id in ("+sql+")";
  73. if(debug){
  74.     out.print("<br>sql="+sql);
  75. }
  76. try{
  77.     Connection con=DBCon.getConnection();
  78.     PreparedStatement pstmt=con.prepareStatement(sql);
  79.     pstmt.executeUpdate();
  80.     pstmt.close();
  81.     if(debug){
  82.         out.print("<BR>delete errorpad sql="+sql);
  83.     }
  84.         response.sendRedirect("errorpad.jsp?page="+strPage);
  85.         //Tools.showJS("window.open('admin_subject.jsp','_self')",out);
  86.     }
  87.     catch(SQLException se){
  88.         out.println(se.toString());
  89.     }
  90.     catch(Exception e){
  91.         out.print(e.toString());
  92.     }
  93.     finally{
  94.         DBCon.dropConnection();
  95.     }
  96. }
  97. %>