<%@page contentType="text/html;charset=GBK"%>
<%@page import="java.sql.*"%>
<%@ include file="/public/checkvalidadmin.jsp"%>
<jsp:useBean id="conn" scope="page" class="test.ConnOracle"/>
<HTML>
	<HEAD>
	    <title>学生密码查询</title>
		<link rel="stylesheet" href="../public/style.css">
	</HEAD>

	<BODY class="ss">
	<center>
       <form action="querystudentpwd.jsp" method="post">
	   请输入学生的身份证号码：<input type="text" name="certid" maxlength=18><br>
	   <input type="submit" value="查询">&nbsp;&nbsp;
	   <input type="reset"  value="清空重写">
	   <hr>
	   <%
	   String userid = "";
	   String password = "";
       String certid = request.getParameter("certid");
	   if(certid==null || certid.equals("")) {
	       out.println("请输入合法的身份证号码后，单击查询按钮<br>");
		   return;
	   }
	   String sql = "select studentid,password from test_studentinfo where ";
	   sql += "certid = '" + certid + "'";
	   ResultSet rs = conn.executeQuery( sql );
	   if(!rs.next()) {
	       out.println("没有符合条件的学生信息<br>");
		   return;
	   }
       out.println("<br>学生编号：" + rs.getInt("studentid") + "<br>");
       out.println("密码：" + rs.getString("password"));

	   %>
	   </form>
	</center>
	</BODY>
</HTML>