chakan1.jsp~14~
上传用户: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.            <a href="chakan.jsp">返回</a>
  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>