chakan1.jsp~12~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:3k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.sql.*" %>
- <%@ page language="java" %>
- <%@ page import="java.util.*" %>
- <%@ page import="proj112.*" %>
- <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
- <html>
- <head>
- <title>
- xuanke_1
- </title>
- </head>
- <body bgcolor="#ffffff">
- <% String stu_id=request.getParameter("stu_id");
- int totalrecord = 0;
- String sql="";
- String sql1="";
- String sql2="";
- String name="";
- sql="SELECT * FROM student where stu_id='"+stu_id+"'";
- ResultSet rs=a.executeQuery(sql);
- if(rs.next())
- {
- name=rs.getString("stu_name");
- %>
- <br> 学号:<font color="red"><%=stu_id %></font> 姓名:<font color="red"><%=name %></font>,所学基本课程成绩如下:<br><br><hr><br><br>
- <% sql1 = "SELECT count(*) as recordcount FROM 成绩关联 where stu_id='"+stu_id+"'";
- ResultSet bs = a.executeQuery(sql1);
- session.setAttribute("stu_id",stu_id);
- if (bs.next())
- {
- totalrecord = bs.getInt("recordcount");
- if(totalrecord!=0){
- sql2="SELECT * FROM chengji,成绩关联 where chengji.课程号=成绩关联.课程号 and 成绩关联.stu_id='"+stu_id+"'";
- ResultSet ts=a.executeQuery(sql2);
- %>
- <p align="center">
- <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;">
- <tr>
- <td align="center"><font color="#6633CC">学期号</font></td>
- <td align="center"><font color="#6633CC">课程号</font></td>
- <td align="center"><font color="#6633CC">课程名</font></td>
- <td align="center"><font color="#6633CC">学分</font></td>
- <td align="center"><font color="#6633CC">主讲教师</font></td>
- <td align="center"><font color="#6633CC">成绩</font></td>
- <td align="center"><font color="#6633CC">重修成绩</font></td>
- <td align="center"><font color="#6633CC">成绩修改</font></td>
- </tr>
- <%
- while(ts.next()){%>
- <tr>
- <td align="center"><%=ts.getString(1)%></td><%String kechenghao=ts.getString(2); %>
- <td align="center"><%=ts.getString(2)%></td>
- <td align="center"><%=ts.getString(3)%></td>
- <td align="center"><%=ts.getString(4)%></td>
- <td align="center"><%=ts.getString(5)%></td>
- <td align="center"><%=ts.getString(9)%></td>
- <td align="center"><%=ts.getString(10)%></td>
- <td align="center"><a href="chakan11.jsp?id=<%=kechenghao%>">修改</a></td>
- </tr>
- <%} %>
- </table>
- <%}else
- {%>
- <script language="javascript">
- alert("该学生没有成绩记录");
- history.go(-1);
- history.go(0);
- </script>
- <%}
- }else
- {%>
- <script language="javascript">
- alert("该学生没有成绩记录");
- history.go(-1);
- history.go(0);
- </script>
- <%}
- }
- else
- {%>
- <script language="javascript">
- alert("没有你输入的学生,请重新输入");
- history.go(-1);
- history.go(0);
- </script>
- <%}
- %>
- </body>