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

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %>
  2. <%@ page import="java.sql.*"%>
  3. <%@ page import="jinghua.*"%>
  4. <%@ page import="java.util.*"%>
  5. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  6. </jsp:useBean>
  7. <%!
  8. Connection con;
  9. boolean debug=false;
  10. String studentID="";
  11. String gradenote="";
  12. Statement stmt=null;
  13. ResultSet rs=null;
  14. String sql="";
  15. class mn_test{
  16.     int id;
  17.     String name;
  18.     String gradenote;
  19. int flag;//1:complete;2:uncomplete;3:do not any test;
  20.     public String toString(){
  21.         String temp="";
  22.         temp="<br> id="+id+"<br> gradenote="+gradenote+"<br> name="+name;
  23.         return temp;
  24.    }
  25. };
  26. %>
  27. <%
  28. Vector tests=new Vector();
  29. try{
  30.     studentID=(String)session.getAttribute("studentID");
  31.     if(studentID==null){
  32.         throw new Exception();
  33.     }
  34. }catch(Exception e){
  35.     Tools.showalert("您还没有登录,或连接超时,请重新登录!",out);
  36.     Tools.showJS("window.open('../../login.jsp','_parent')",out);
  37. }
  38. try{
  39.     con=DBCon.getConnection();
  40.     //获取学生的年级信息
  41.     sql="select id,gradenote from UserInfo where vcUserNo='"+studentID+"'";
  42.         stmt=con.createStatement();
  43.         rs=stmt.executeQuery(sql);
  44.         if(rs.next()){
  45.             gradenote=rs.getString("gradenote");
  46.             rs.close();
  47.             stmt.close();
  48.         }
  49.         if(debug){
  50.             out.print("<br>stuID="+studentID+"<br>gradenote="+gradenote);
  51.         }
  52.     //查询该年级的模拟考试信息
  53.     sql="select * from mn_test where grade_note='"+gradenote+"' order by begin_date" ;
  54.         stmt=con.createStatement();
  55.         rs=stmt.executeQuery(sql);
  56.         while(rs.next()){
  57.             mn_test t=new mn_test();
  58. t.flag=0;
  59.             t.id=rs.getInt("id");
  60.             t.name=rs.getString("name");
  61.             t.gradenote=rs.getString("grade_note");
  62.             tests.addElement(t);
  63.         }
  64.         rs.close();
  65.         stmt.close();
  66.         if(debug){
  67.             out.print(tests.toString());
  68.         }
  69. //查询学生的所有模拟考试情况
  70. %>
  71. <html>
  72. <head>
  73. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  74. <META NAME="DESCRIPTION" CONTENT="共创学堂-成绩统计图表">
  75. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  76. <META HTTP-EQUIV="Window-target" CONTENT="_top">
  77. <title>共创学堂-成绩统计图表</title>
  78. <link rel="stylesheet" href="../common/style.css" type="text/css">
  79. </head>
  80. <body bgcolor="#EEEEEE" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
  81. <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#EEEEEE">
  82.   <tr>
  83.     <td colspan="2" height="15">&nbsp;</td>
  84.   </tr>
  85.   <tr>
  86.     <td width="15"> <br>
  87.       <br>
  88.     </td>
  89.     <td>
  90.       <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  91.         <tr>
  92.           <td width="24" height="22">
  93.             <table border="0" cellspacing="0" cellpadding="0">
  94.               <tr>
  95.                 <td bgcolor="#EEEEEE"><img src="../images/0cir.gif" width="24" height="22"></td>
  96.               </tr>
  97.             </table>
  98.           </td>
  99.         </tr>
  100.         <tr>
  101.           <td height="400" valign="top" bgcolor="#FFFFFF">
  102.             <table width="80%" border="0" cellspacing="3" cellpadding="0" align="center">
  103. <tr>
  104.                 <td width="35" height="40" align="center"><img src="../images/personinfo.gif" width="32" height="32"></td>
  105.                 <td height="40"> <FONT color=#333300> <a href="../abandon_session.jsp">★Abort
  106.                   Session</a> </FONT> </td>
  107.         </tr>
  108.               <%for(int i=0;i<tests.size();i++){
  109.             mn_test t=(mn_test)tests.elementAt(i);
  110.         %>
  111.                 <tr>
  112.                 <td width="35" height="40" align="center"><img src="../images/icon_splccx.gif" width="32" height="32"></td>
  113.                 <td height="40"> <FONT color=#333300> <a href="../stu_mn_chart.jsp?stuID=<%=studentID%>&mn_testID=<%=t.id%>"
  114.                  title="<%=t.name%>"   target="mainFrame"> ★ <%=t.name%> </a></FONT>
  115.                 </td>
  116.         </tr>
  117.          <%}%>
  118.             </table>
  119.   <p>&nbsp;</p></td>
  120.         </tr>
  121.         <tr>
  122.           <td width="24" height="22">
  123.             <table border="0" cellspacing="0" cellpadding="0">
  124.               <tr>
  125.                 <td bgcolor="#EEEEEE"><img src="../images/0cir_bl.gif" width="24" height="22"></td>
  126.               </tr>
  127.             </table>
  128.           </td>
  129.         </tr>
  130.       </table>
  131.     </td>
  132.   </tr>
  133.   <tr>
  134.     <td colspan="2" height="15">&nbsp;</td>
  135.   </tr>
  136. </table>
  137. </body>
  138. </html>
  139. <%}
  140. catch(SQLException se){
  141.     out.print("<br> sql error sql="+sql);
  142.     out.print("<br>"+se.toString());
  143. }
  144. catch(Exception e){
  145.     System.out.print(e.toString());
  146.     out.print("<br>  sql="+sql);
  147.     out.print("<br>"+e.toString());
  148. }
  149. finally{
  150.     DBCon.dropConnection();
  151. }
  152. %>