chakan1.jsp~16~
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:3k
源码类别:

Jsp/Servlet

开发平台:

VBScript

  1. <%@ page contentType="text/html; charset=GBK" %>
  2. <%@ page import="java.sql.*" %>
  3. <%@ page language="java" %>
  4. <%@ page import="java.util.*" %>
  5. <%@ page import="proj112.*" %>
  6. <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
  7. <html>
  8. <head>
  9. <title>
  10. xuanke_1
  11. </title>
  12. </head>
  13. <body bgcolor="#ffffff">
  14.   <a href="chakan.jsp">返回</a>
  15.    <%  String stu_id=request.getParameter("stu_id");
  16.        int totalrecord = 0;
  17.        String sql="";
  18.        String sql1="";
  19.        String sql2="";
  20.        String name="";
  21.        sql="SELECT * FROM student where stu_id='"+stu_id+"'";
  22.        ResultSet rs=a.executeQuery(sql);
  23.  if(rs.next())
  24.    {
  25.      name=rs.getString("stu_name");
  26.      %>
  27.      <br> 学号:<font color="red"><%=stu_id %></font>&nbsp;&nbsp; 姓名:<font color="red"><%=name %></font>,所学基本课程成绩如下:<br><br><hr><br><br>
  28.      <%  sql1 = "SELECT count(*) as recordcount FROM 成绩关联 where stu_id='"+stu_id+"'";
  29.      ResultSet bs = a.executeQuery(sql1);
  30.         session.setAttribute("stu_id",stu_id);
  31.      if (bs.next())
  32.      {
  33.        totalrecord = bs.getInt("recordcount");
  34.        if(totalrecord!=0){
  35.          sql2="SELECT * FROM chengji,成绩关联 where chengji.课程号=成绩关联.课程号 and 成绩关联.stu_id='"+stu_id+"'";
  36.          ResultSet ts=a.executeQuery(sql2);
  37.          %>
  38.          <p align="center">
  39.       <table cellspacing="0" cellpadding="4" rules="all" bordercolor="#CC9966" border="1" id="dg_rxkb" style="background-color:White;border-color:#CC9966;border-width:1px;border-style:None;width:100%;border-collapse:collapse;">
  40.              <tr>
  41.                <td align="center"><font color="#6633CC">学期号</font></td>
  42.                <td align="center"><font color="#6633CC">课程号</font></td>
  43.                <td align="center"><font color="#6633CC">课程名</font></td>
  44.                <td align="center"><font color="#6633CC">学分</font></td>
  45.                <td align="center"><font color="#6633CC">主讲教师</font></td>
  46.                <td align="center"><font color="#6633CC">成绩</font></td>
  47.                <td align="center"><font color="#6633CC">重修成绩</font></td>
  48.                <td align="center"><font color="#6633CC">成绩修改</font></td>
  49.              </tr>
  50.              <%
  51.              while(ts.next()){%>
  52.              <tr>
  53.                <td align="center"><%=ts.getString(1)%></td><%String kechenghao=ts.getString(2); %>
  54.                <td align="center"><%=ts.getString(2)%></td>
  55.                <td align="center"><%=ts.getString(3)%></td>
  56.                <td align="center"><%=ts.getString(4)%></td>
  57.                <td align="center"><%=ts.getString(5)%></td>
  58.                <td align="center"><%=ts.getString(9)%></td>
  59.                <td align="center"><%=ts.getString(10)%></td>
  60.                <td align="center"><a href="chakan11.jsp?id=<%=kechenghao%>">修改</a></td>
  61.              </tr>
  62.              <%} %>
  63.            </table>
  64.            <%}else
  65.            {%>
  66.            <script language="javascript">
  67.            alert("该学生没有成绩记录");
  68.            history.go(-1);
  69.            history.go(0);
  70.            </script>
  71.            <%}
  72.            }else
  73.            {%>
  74.            <script language="javascript">
  75.            alert("该学生没有成绩记录");
  76.            history.go(-1);
  77.            history.go(0);
  78.            </script>
  79.            <%}
  80.            }
  81.    else
  82.      {%>
  83.      <script language="javascript">
  84.      alert("没有你输入的学生,请重新输入");
  85.      history.go(-1);
  86.      history.go(0);
  87.      </script>
  88.    <%}
  89.       %>
  90. </body>