chakan1.jsp~12~
上传用户: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.    <%  String stu_id=request.getParameter("stu_id");
  15.        int totalrecord = 0;
  16.        String sql="";
  17.        String sql1="";
  18.        String sql2="";
  19.        String name="";
  20.        sql="SELECT * FROM student where stu_id='"+stu_id+"'";
  21.        ResultSet rs=a.executeQuery(sql);
  22.  if(rs.next())
  23.    {
  24.      name=rs.getString("stu_name");
  25.      %>
  26.      <br> 学号:<font color="red"><%=stu_id %></font>&nbsp;&nbsp; 姓名:<font color="red"><%=name %></font>,所学基本课程成绩如下:<br><br><hr><br><br>
  27.      <%  sql1 = "SELECT count(*) as recordcount FROM 成绩关联 where stu_id='"+stu_id+"'";
  28.      ResultSet bs = a.executeQuery(sql1);
  29.         session.setAttribute("stu_id",stu_id);
  30.      if (bs.next())
  31.      {
  32.        totalrecord = bs.getInt("recordcount");
  33.        if(totalrecord!=0){
  34.          sql2="SELECT * FROM chengji,成绩关联 where chengji.课程号=成绩关联.课程号 and 成绩关联.stu_id='"+stu_id+"'";
  35.          ResultSet ts=a.executeQuery(sql2);
  36.          %>
  37.          <p align="center">
  38.       <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;">
  39.              <tr>
  40.                <td align="center"><font color="#6633CC">学期号</font></td>
  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.              </tr>
  49.              <%
  50.              while(ts.next()){%>
  51.              <tr>
  52.                <td align="center"><%=ts.getString(1)%></td><%String kechenghao=ts.getString(2); %>
  53.                <td align="center"><%=ts.getString(2)%></td>
  54.                <td align="center"><%=ts.getString(3)%></td>
  55.                <td align="center"><%=ts.getString(4)%></td>
  56.                <td align="center"><%=ts.getString(5)%></td>
  57.                <td align="center"><%=ts.getString(9)%></td>
  58.                <td align="center"><%=ts.getString(10)%></td>
  59.                <td align="center"><a href="chakan11.jsp?id=<%=kechenghao%>">修改</a></td>
  60.              </tr>
  61.              <%} %>
  62.            </table>
  63.            <%}else
  64.            {%>
  65.            <script language="javascript">
  66.            alert("该学生没有成绩记录");
  67.            history.go(-1);
  68.            history.go(0);
  69.            </script>
  70.            <%}
  71.            }else
  72.            {%>
  73.            <script language="javascript">
  74.            alert("该学生没有成绩记录");
  75.            history.go(-1);
  76.            history.go(0);
  77.            </script>
  78.            <%}
  79.            }
  80.    else
  81.      {%>
  82.      <script language="javascript">
  83.      alert("没有你输入的学生,请重新输入");
  84.      history.go(-1);
  85.      history.go(0);
  86.      </script>
  87.    <%}
  88.       %>
  89. </body>