xuanxiuke1.jsp
资源名称: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);
- if (bs.next())
- {
- totalrecord = bs.getInt("recordcount");
- if(totalrecord!=0){
- sql2="SELECT * FROM 选课关联,kecheng where 选课关联.kch=kecheng.kch and 选课关联.stu_id='"+stu_id+"'";
- ResultSet ts=a.executeQuery(sql2);
- %>
- <p align="center">
- <table width="100%" 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>
- </tr>
- <%
- while(ts.next()){%>
- <tr>
- <td align="center"><%=ts.getString("kch")%></td>
- <td align="center"><%=ts.getString("kcm")%></td>
- <td align="center"><%=ts.getString("rkjs")%></td>
- <td align="center"><%=ts.getString("xqj")%></td>
- <td align="center"><%=ts.getString("sj")%></td>
- <td align="center"><%=ts.getString("skjs")%></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>
- <%}
- %>
- <br><br><br>
- <a href="xuanxiuke.jsp">返回</a>
- </body>