studentscore_1.jsp
资源名称:examasp.rar [点击查看]
上传用户:hjt198082
上传日期:2015-04-16
资源大小:95k
文件大小:2k
源码类别:
MySQL数据库
开发平台:
Java
- <%@page contentType="text/html;charset=GBK"%>
- <%@page import="java.sql.*"%>
- <%@ include file="/public/checkvalidadmin.jsp"%>
- <jsp:useBean id="conn" scope="page" class="test.ConnOracle"/>
- <%!
- ResultSet rs = null;
- String sql = "";
- String classid = "";
- %>
- <%
- classid = request.getParameter("classid");
- if(classid==null) {
- out.println("未得到班级相关信息!");
- return;
- }
- sql = "select distinct convert(char(8),starttime,3) as examtime from test_result ";
- sql+= "where classid=" + classid + " order by examtime desc ";
- try {
- rs = conn.executeQuery( sql );
- }catch(Exception ee) {
- out.println("<center>");
- out.println("访问学生考试结果信息出错!请将以下信息告知系统管理员。<br>");
- out.println(ee.toString() + "<br>");
- out.println("<a href=javascript:history.back()>单击这里返回</a>");
- out.println("</center>");
- }
- if(!rs.next()) {
- out.println("数据库中没有考试结果信息!");
- return;
- }
- %>
- <HTML>
- <HEAD>
- <title>察看学生成绩</title>
- <link rel="stylesheet" href="../public/style.css">
- </HEAD>
- <BODY class="ss">
- <br><br><br><br><br><br>
- <center>
- <form action="studentscore_2.jsp" method="post">
- <input type="hidden" name="classid" value="<%=classid%>">
- 请选择考试日期:
- <select name=examtime>
- <%
- String tmp;
- do {
- tmp = rs.getString("examtime");
- out.println("<option value=" + tmp + ">" + tmp + "</option>");
- }while(rs.next());
- %>
- </select>
- <br><br><br><br><br><br><br>
- <input type="submit" value="察看学生成绩">
- <input type="reset" value="重新选择">
- </form>
- </center>
- </BODY>
- </HTML>