⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 b0f8f21e091d00171e8bdfdf825d5f86

📁 实习的时候做的数字校园系统
💻
字号:
<%@ page import="java.sql.*"%>
<%@ page import="com.xxgl.data.DBConnection"%>

<%@ page language="java" contentType="text/html; charset=GBK"
    pageEncoding="GBK"%>
	


<html>
<head>

</head>
<SCRIPT language=Javascript src='js/jsfunc.js'></SCRIPT>
<script language="JavaScript">
    
	
	
				
   function my_find()
   { 
	    document.form1.action ="selectstudent2.jsp";	
		document.form1.method = "post"
		document.form1.submit();


}

   function my_update(testid)
	{
	 
	   var check="";
       if (document.getElementsByName('checkbox'+testid)[0].checked)
         check=1;
       else
          check=0;
         window.location.href("updatestudent.jsp?test_id="+testid+"&yesorno="+check);
	   
       
	  	 
	}		
</script>


<body bgColor="#dee7ff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">

<% 


//以try开始
try
{ 




 //建一个数据库连接
Connection con = DBConnection.getConnection();
Statement stmt;
ResultSet rs;
stmt = con.createStatement();

String selectsql="SELECT testid,s_name,sex,age,in_year,jg,zzmm,adress,phone,yesorno,memory from newstudent";


//查询记录
rs = stmt.executeQuery(selectsql);
//输出查询结果

%>

<form name="form1"> 
<br><center>

<table cellSpacing="0" cellPadding="0" width="650" bgColor="#dee7ff" border="0">
  <tbody>
  <tr>
    <td vAlign="center" align="middle" width="100%" bgColor="#dee7ff" colSpan="2">
      <table borderColor="#ffffff" cellSpacing="0" cellPadding="0" width="100%" bgColor="#dee7ff" border="0">
        <tbody>
        <tr>
          <td colSpan="3" height="35">
            <table style="FONT-SIZE: 10pt" borderColor="#ffffff" cellSpacing="0" cellPadding="0" width="100%" bgColor="#dee7ff" border="0">
              <tbody>
              <tr height="35">
                <td align="middle" width="26" background="images/title_left.gif" bgColor="#dee7ff"><img src="images/file1.gif" WIDTH="12" HEIGHT="16"></td>
                <td align="left" width="107" background="images/title_left.gif" bgColor="#dee7ff"><font color="#f7f7f7">&#26032;&#29983;&#27880;&#20876;&#31649;&#29702;</font> </td>
                <td align="middle" width="10" background="images/title_middle.gif" bgColor="#dee7ff"><font color="#f7f7f7">&nbsp;</font> </td>
                <td width="457" align="middle" background="images/title_right.gif" bgColor="#dee7ff"><font color="#f7f7f7">&nbsp;</font> 
              </td></tr></tbody></table></td></tr>
        <tr>
          <td class="formclass_showTd" vAlign="center" align="middle" width="100%" bgColor="#dee7ff">
            <table borderColor="#2955b5" cellSpacing="0" cellPadding="0" width="100%" bgColor="#dee7ff" border="0">
              <tbody>
              <tr>
                <td>
                  <table borderColor="#ffffff" cellSpacing="0" cellPadding="0" width="100%" bgColor="#dee7ff" border="0">
                    <tbody>                    
                    <tr height="25">
                      <td width="50%" align="ceter" vAlign="center" bgColor="#dee7ff">&nbsp;姓名: 
						<input name="findkey" type="text" size="30" maxlength="20">					  </td>
                      <td vAlign="center" align="middle" width="1%" bgColor="#dee7ff"><table style="FONT-SIZE: 10pt" borderColor="#ffffff" height="100%" cellSpacing="0" cellPadding="0" width="1" bgColor="#dee7ff" border="0">
                          <tbody>
                          <tr>
                            <td width="3" background="images/bar_ver.gif" height="100%"></td></tr></tbody></table></td>
					  <td width="29%" align="middle" vAlign="center" bgColor="#dee7ff"><img src="images/find.gif" id="submit2" style="cursor:hand" onclick="javascript:my_find();"  WIDTH="54" HEIGHT="21">
                        <a href="addnewstudent.jsp?"><img src="images/add.gif" width="54" height="21" border="0"></a> </td>
                    </tr>
                   
                    <tr height="3">
                      <td align="middle" background="images/smallbar.gif" bgColor="#dee7ff" colSpan="5"></td></tr>
                    </tbody></table></td></tr></tbody></table></td></tr>
            </tbody></table></td></tr></tbody></table>


<table style="FONT-SIZE: 10pt" cellSpacing="0" cellPadding="0" width="650" bgColor="#f7f7f7" border="0">
  <tbody>
  <tr height="28">
      <td width="20" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"><img height="20" src="images/blank.gif" width="20"></td>
    <td width="26" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7">ID</td>
    <td width="49" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> 姓名</td>
    <td width="41" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7">性别 </td>
    <td width="41" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7">年龄 </td>
    <td width="71" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> 入学时间</td>
	<td width="61" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> 籍贯</td>
	<td width="70" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> 政治面貌</td>
	<td width="91" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> 家庭地址</td>
	<td width="87" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> 电话号码</td>
	<td width="63" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7">缴费入学</td>
    <td width="40" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7">修改</td>
    <td width="45" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7">删除</td>
    </tr>
	


						
						
<% 
while (rs.next())
{
int col1 = rs.getInt(1);
String col2 = rs.getString(2);

String col3="";
 if(rs.getInt(3)==1) 
 col3="男";
 else
  col3="女";

int col4 = rs.getInt(4);
int col5 = rs.getInt(5);
String col6 = rs.getString(6);
String col7 = rs.getString(7);
String col8 = rs.getString(8);
String col9 = rs.getString(9);

String col10="";
 if(rs.getInt(10)==1) 
  col10="checked";
 else
  col10="";
  


//打印所显示的数据
out.println("<tr><td></td><td>"+col1+"</td><td>"
+col2+"</td><td>"
+col3+"</td><td>"
+col4+"</td><td>"
+col5+"</td><td>"
+col6+"</td><td>"
+col7+"</td><td>"
+col8+"</td><td>"
+col9+"</td><td>");

%>
  <input name="checkbox<%=col1%>" type="checkbox"  value="checkbox" <%=col10%>  onclick="javascript:my_update(<%out.println(col1); %>);"></td>


	                    <td align="left" vAlign="bottom" borderColor="#3b82f1" bgColor="#f7f7f7">
	                   <img src="images/go_mod.gif" id="submit12"    WIDTH="21" HEIGHT="21"></td>
						<td align="left" vAlign="bottom" borderColor="#3b82f1" bgColor="#f7f7f7">
						 <a href="deletestudent.jsp?test_id=<%=(col1)%>"><img src="images/go_del.gif" width="20" height="20" border="0"></a></td>
	                 </tr>
	                 
	                 <tr height="1">
						<td vAlign="center" borderColor="#3b82f1" align="left" bgColor="#f7f7f7"></td>
						<td vAlign="center"" borderColor="#3b82f1" align="left" background="images/line.gif" bgColor="#f7f7f7" colspan="12"></td>
					  </tr>
<% 
}
//关闭数据库连结
rs.close();
stmt.close();
con.close();
}

//捕获错误信息
catch (Exception e) {out.println(e.getMessage());}
%>
						
					
					  

      

  
  <tr height="28">
    <td width="20" align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"><img height="20" src="images/blank.gif" width="20"></td>
    <td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
    <td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
    <td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
	<td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
	<td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
	<td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
	<td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
	<td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
	<td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
		<td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"> </td>
	
    <td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"></td>
    <td align="left" vAlign="center" borderColor="#3b82f1" background="images/list_middle.jpg" bgColor="#f7f7f7"></td>
    </tr></tbody></table>
  
<table style="FONT-SIZE: 10pt" cellSpacing="0" cellPadding="0" width="650" bgColor="#dee7ff" border="0">
  <tbody>
  <tr>
    <td vAlign="center" noWrap align="right">&nbsp;
	 </td>
  </tr></tbody></table>

</form>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -