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

📄 mylibsearch.jsp

📁 基于jsp的图书管理系统的功能和实现
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="data.LoginData"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/html">
<!--
.STYLE1 {font-size: 9px}
-->
</style>
<style type="text/css">
<!--
.STYLE9 {font-size: 24px; font-weight: bold; color: #3399FF; }
.STYLE10 {font-size: 24px; font-weight: bold; color: #000000; }
.STYLE13 {font-size: 24px; font-weight: bold; color: #FFFFFF; }
.STYLE14 {
	color: #FFFFFF;
	font-weight: bold;
}
.STYLE15 {
	font-size: 18px;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<jsp:useBean id="show" class="Bean.MachSearch" scope="page">
</jsp:useBean>
<jsp:useBean id="connDbBean" scope="page" class="db.dbConn"/>
<%
 Connection conn=null;
 Statement stmt=null;
 ResultSet rs=null;
 String strSql="";
 String username=null;
 String password=null;
 int PageSize=15;
 int Page=1;
 int totalPage=1;
 int totalrecord=0;
  int totalrecord1=0;
%>
<table width="975" border="0" cellpadding="0" cellspacing="0" bordercolor="#333399">
  <!--DWLayoutTable-->
  <tr>
    <td height="76" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="171" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="171" height="76" valign="middle"><img src="image/tushu2.bmp" /></td>
          </tr>
        </table>        </td>
        <td width="75" height="28">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="18">&nbsp;</td>
        <td width="101">&nbsp;</td>
        <td width="26">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="30">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="49">&nbsp;</td>
        <td width="100">&nbsp;</td>
        <td width="105">&nbsp;</td>
      </tr>
      <tr>
        <td height="48">&nbsp;</td>
        <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="102" height="48" align="center" valign="bottom" bgcolor="#E4E4E4"><a href="Search.jsp" class=STYLE10 STYLE11 >图书检索</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
           <td width="100" height="48" align="center" valign="bottom" bgcolor="#3366CC"><a href="Mylibary.jsp" class="STYLE13">我的图书</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="100" height="48" align="center" valign="bottom" bgcolor="#E4E4E4"><a href="studentIndex.jsp" class="STYLE10">新书通报</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="100" height="48" align="center" valign="bottom" bgcolor="#E4E4E4" class="STYLE9"><a href="ShowInfor.jsp" class="STYLE10">信息发布</a></td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="100" height="48" align="center" valign="bottom"><!--DWLayoutEmptyCell-->&nbsp;</td>
              </tr>
        </table></td>
        <td>&nbsp;</td>
      </tr>
      
      
      
    </table></td>
  </tr>
  <tr>
    <td height="30" colspan="5" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="975" height="30" bgcolor="#3366CC">&nbsp;</td>
      </tr>
    </table>    </td>
  </tr>
  <tr>
    <td width="19" height="28">&nbsp;</td>
    <td width="90">&nbsp;</td>
    <td width="22">&nbsp;</td>
    <td width="754">
	 <%
	      username =(String)session.getAttribute("User");
	       password=(String)session.getAttribute("Pass");
	  
							out.print("姓名:");
							out.print(username);
							out.print("     ");
							out.print("密码");
							out.print(password);
	 %>
	&nbsp;</td>
    <td width="90">&nbsp;</td>
  </tr>
  <tr>
    <td height="28">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td rowspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="754" height="374" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="754" height="374" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <!--DWLayoutTable-->
              <tr>
                <td width="754" height="374" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <!--DWLayoutTable-->
                  <tr>
                    <td width="715" height="386" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <!--DWLayoutTable-->
                      <tr>
                        <td width="127" height="33" valign="top"><table width="100%" border="3" cellpadding="0" cellspacing="0" bordercolor="#3366CC">
                          <!--DWLayoutTable-->
                          <tr>
                            <td width="127" height="33" align="left" valign="bottom" bgcolor="#3366CC"><span class="STYLE14">以借图书</span></td>
                            </tr>
                          </table>                        </td>
                                <td width="247">&nbsp;</td>
                                <td width="341"></td>
                        </tr>
                      <tr>
                        <td height="341" colspan="2" valign="top"><table width="98%" border="3" cellpadding="0" cellspacing="0" bordercolor="#3366CC">
                          <!--DWLayoutTable-->
                          <tr>
                            <td width="360" height="341" align="center" valign="middle">&nbsp;
                              
                              <%
		  
	try{
	    
		 LoginData loginData = new LoginData(); 
	     conn = loginData.getConn(        );
		stmt=conn.createStatement(
		ResultSet.TYPE_SCROLL_INSENSITIVE,
		ResultSet.CONCUR_READ_ONLY);
		strSql = "SELECT count(*) as recordcount FROM  Bcurrent where BcRnumber='"+username+"'";
		rs = stmt.executeQuery(strSql);
		if (rs.next()) totalrecord = rs.getInt("recordcount");
	    strSql= "SELECT * FROM Bcurrent  where BcRnumber='"+username+"'";
	      rs = stmt.executeQuery(strSql);
	      if(totalrecord%PageSize==0)totalPage=totalrecord/PageSize;
	      else totalPage=(int)Math.floor(totalrecord/PageSize)+1;
		  
	       if(totalPage==0)totalPage=1;
	        if(request.getParameter("Page")==null||request.getParameter("Page").equals(""))
	          Page=1;
	          else{
 	             try{
	                   Page=Integer.parseInt(request.getParameter("Page"));
	                }catch(java.lang.NumberFormatException e){
	                  Page=1;
	                 }
	                
	              }   
	             if(Page<1)Page=1;
	             if(Page>totalPage)Page=totalPage;
	               rs.absolute((Page-1)*PageSize+1);
	               out.print("<table border='1' width='700' border='300' cellpadding='0' cellspacing='0' bordercolor='#3366CC'>");
	               out.print("<tr bgcolor='#6699CC'><td><font color=''><b>"+"读者编号"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"图书编号"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"图书名称"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"借出日期"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"应还日期"+"</b></font></td>");
                   out.print("<td><font color=''><b>"+"是否归还(0:没还1:还)"+"</b></font></td></tr>");
                   
                      for(int iPage=1;iPage<=PageSize;iPage++)   {
                       out.print("<TD><A HREF='ShowStudent.jsp?id="+rs.getString("BcRnumber")+"'>"+rs.getString("BcRnumber")+"</A></TD>");
					    out.print("<TD><A HREF='ShowSearchBook.jsp?id="+rs.getString("BcBnumber")+"'>"+rs.getString("BcBnumber")+"</A></TD>");
					   out.print("<td>"+rs.getString("BcBname")+"</td>");
                       out.print("<td>"+rs.getDate("Bctodate")+"</td>"); 
                       out.print("<td>"+rs.getDate("Bcshoulddate")+"</td>");
                       out.print("<td>"+rs.getInt("Bcstatus")+"</td></tr>");
                      
                 
                        if(!rs.next()) break;
                       }
                    out.print("</table>");  
		}
		catch(SQLException e){
	    System.out.println(e.getMessage());
		}
	    finally{
		stmt.close();
		conn.close();
			}
		   %>							</td>
                              </tr>
                          </table></td>
                          <td></td>
                        </tr>
                      
                    </table></td>
                    <td width="39">&nbsp;</td>
                  </tr>
                </table>                </td>
              </tr>
            </table>            </td>
          </tr>
        </table>        </td>
        </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="31">&nbsp;</td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="90" height="31" align="center" valign="bottom"><a href="Modify_Code.jsp" class="STYLE15">修改密码</a></td>
      </tr>
    </table>
    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="327">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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