<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查询结果</title>
<style type="text/css">
<!--
body {
	background-image: url(picture/back010.gif);
}
.style2 {font-size: 24px}
.style3 {color: #339900}
.style6 {font-size: 24px; color: #339900; }
.style8 {font-size: 24px; color: #669900; }
.style9 {color: #669900}
.style10 {color: #6633CC}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>
<%
String xh = request.getParameter("xh");//取得学号
String passwd = request.getParameter("passwd");//取得密码
//生成sql语句
String sql = "select * from stu where xh='"+xh+"' and passwd = '"+passwd+"'";
String xm ="";//保存姓名
String jg ="";//保存籍贯
String rxsj ="";//保存入学时间
String yx ="";//保存所属院系
String dxyy ="";//保存大学英语成绩
String gdsx ="";//保存高等数学成绩
String sjk ="";//保存数据库成绩
String jsjwx ="";//保存计算机维修成绩

//下面的代码连接数据库
String AccessDriver="sun.jdbc.odbc.JdbcOdbcDriver";
String ConnStr="jdbc:odbc:regist";
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
Class.forName(AccessDriver);	
conn=DriverManager.getConnection(ConnStr);
stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
//学号和密码合法，则执行下面的语句，获取各项内容
if (rs.next()) {
  xm=rs.getString("xm");
  jg=rs.getString("jg");
  rxsj=rs.getString("rxsj");
  yx=rs.getString("yx");
  dxyy=rs.getString("dxyy");
  gdsx=rs.getString("gdsx");
  sjk=rs.getString("sjk");
  jsjwx=rs.getString("jsjwx");
}
//不合法，则转入另外一个页面
else{
%>
<jsp:forward page="shibai.jsp"/>
<%
}
%>
<div id="Layer1" style="position:absolute; width:1279px; height:115px; z-index:1">
  <div align="left">
    <p><img src="picture/bullet2.gif" width="83" height="80">　　<span class="style2">恭喜你！你已经成功登陆，</span></p>
    <p>　　　　　　　　<span class="style2">下面是你的基本信息和考试成</span><span class="style2">绩</span>　：<img src="picture/bullet2.gif" width="87" height="91">　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　　</p>
  </div>
</div>
<div id="Layer2" style="position:absolute; width:1091px; height:179px; z-index:2; left: 22px; top: 257px;">
  <table width="1146" height="163" border="1">
    <tr>
      <td width="90" height="81"><div align="center" class="style2 style3">姓名</div></td>
      <td width="83"><div align="center"><span class="style6">学号</span></div></td>
      <td width="120"><div align="center">
        <p class="style2 style9">籍贯</p>
      </div></td>
      <td width="124"><div align="center"><span class="style8">入学时间</span></div></td>
      <td width="162"><div align="center"><span class="style8">所属院系</span></div></td>
      <td width="107"><div align="center"><span class="style8">大学英语</span></div></td>
      <td width="116"><div align="center"><span class="style8">高等数学</span></div></td>
      <td width="103"><div align="center" class="style8">数据库</div></td>
      <td width="183"><div align="center"><span class="style8">计算机维修</span></div></td>
    </tr>
    <tr>
    <!--将获取的各项信息放入表中-->
      <td height="74"><%=xm%></td>
      <td>&nbsp;<%=xh%></td>
      <td>&nbsp;<%=jg%></td>
      <td>&nbsp;<%=rxsj%></td>
      <td>&nbsp;<%=yx%></td>
      <td>&nbsp;<%=dxyy%></td>
      <td>&nbsp;<%=gdsx%></td>
      <td>&nbsp;<%=sjk%></td>
      <td>&nbsp;<%=jsjwx%></td>
    </tr>
  </table>
  <div id="Layer3" style="position:absolute; width:327px; height:115px; z-index:1; left: 793px; top: 194px; font-size: 24px; color: #6699FF;"><span class="style10">查询完毕，我想<a href="main.jsp">返回首页</a></span>。</div>
</div>
</body>
</html>
