?? stu_test_mn.jsp
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0041)http://jsptestonline.cosoft.org.cn/senior/none_xt.jsp -->
<%@ page contentType="text/html; charset=gb2312" language="java"%>
<%@ page import="java.sql.*" %>
<%@ page import="jinghua.*"%>
<jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
</jsp:useBean>
<%!Connection con;
boolean debug=false;
String studentID="";
String gradenote="";
Statement stmt=null;
ResultSet rs=null;
String sql="";
%>
<%
try{
studentID=(String)session.getAttribute("studentID");
if(studentID==null){
throw new Exception();
}
}catch(Exception e){
Tools.showalert("您還沒有登錄,或連接超時,請重新登錄!",out);
Tools.showJS("window.open('../login.jsp','_self')",out);
}
try{
con=DBCon.getConnection();
//獲取考生的計算機等級信息
//sql="select id,gradenote,grade.Name as gn "+
//"from student INNER JOIN grade ON (student.gradenote = grade.note) "+
//" where stuid='"+studentID+"'";
sql="select id,gradenote from UserInfo where vcUserNo='"+studentID+"'";
try{
stmt=con.createStatement();
rs=stmt.executeQuery(sql);
if(rs.next()){
gradenote=rs.getString("gradenote");
rs.close();
stmt.close();
}
if(debug){
out.print("<br>stuID="+studentID+"<br>gradenote="+gradenote);
}
}
catch(SQLException se){
out.print("<br> query student error sql="+sql);
out.print("<br>"+se.toString());
}
catch(Exception e){
out.print("<br> query student error sql="+sql);
out.print("<br>"+e.toString());
}
%>
<HTML><HEAD><TITLE>考試系統</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK
href="../common/css/style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2722.900" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff text=#000000 vlink="#0000FF">
<CENTER>
<!--begin 內容區 -->
<table width="770" border="0" cellspacing="0" cellpadding="0">
<tr valign="top" align="center">
<td> <br>
<br>
<table width="540" border="0" cellpadding="2" cellspacing="1" bgcolor="#d3add1" class="tboutline">
<tr bgcolor="#FFFFFF">
<td colspan="5" align="center" class="word"><strong>
<%
sql="select * from mn_test where status=2 and grade_note='"+gradenote+"' "+
" order by begin_date";
stmt=con.createStatement();
rs=stmt.executeQuery(sql);
if(!rs.next())
{
out.println("無正式考試信息!");
}
rs.close();
stmt.close();
%>
</strong></td>
</tr>
<%
//查詢該計算機等級(gradenote)的正式考試信息
//正在進行的正式考試
sql="select * from mn_test where status=2 and grade_note='"+gradenote+"' and "+
"begin_date<=CURRENT_DATE order by begin_date";
stmt=con.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
%>
<tr bgcolor="#FFFFFF">
<td colspan="5" class="tbulleft">
<a href="mn_test.jsp?mn_testID=<%=rs.getInt("id")%>&stuID=<%=studentID%>"
title="<%=rs.getString("name")%>"
target="_blank">★ </a><a href="mn_test.jsp?mn_testID=<%=rs.getInt("id")%>&stuID=<%=studentID%>"
title="<%=rs.getString("name")%>"
target="mainFrame"><%=rs.getString("name")%></a><a href="mn_test.jsp?mn_testID=<%=rs.getInt("id")%>&stuID=<%=studentID%>"
title="<%=rs.getString("name")%>"
target="_blank"> </a>
</td>
</tr>
<%
}
rs.close();
stmt.close();
//未來進行的正式考試
sql="select * from mn_test where status=2 and grade_note='"+gradenote+"' and "+
"begin_date>CURRENT_DATE order by begin_date";
stmt=con.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
%>
<tr bgcolor="#FFFFFF">
<td colspan="5" class="tbulleft">★ <%=rs.getString("name")%></td>
</tr>
<%
}
rs.close();
stmt.close();
%>
</table> </td>
</tr>
</table>
<!--end 內容區 -->
<!--begin bottom -->
<!--end bottom --></CENTER></BODY></HTML>
<%}
catch(Exception e){
System.out.print(e.toString());
}
finally{
DBCon.dropConnection();
}
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -