?? search.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,bean.BookInf" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link rel="stylesheet" href="source/bookshop.css" type="text/css">
<jsp:include page="/utility/scriptFunction.jsp" />
<style>
a:link, a:visited{
color: red
text-decoration: none;
}
a:hover{
text-decoration: underline;
color: red;
}
</style>
</head>
<% request.setCharacterEncoding("gb2312");
response.setContentType("text/html; charset=gb2312");
if(session.getAttribute("booklist")==null){
response.sendRedirect("/bookshop/ShowBook");
} else {
Vector booklist=(Vector)session.getAttribute("booklist");
String pg;
if(request.getParameter("pg")==null){
pg="1";
}else{
pg=request.getParameter("pg");
}
int pgSum=(int)(booklist.size()+5)/6;
int index=(Integer.parseInt(pg)-1)*6;
%>
<body onmousemove="closesubnav(event);">
<div id="masthead">
<jsp:include page="/utility/siteName.jsp" />
<jsp:include page="/utility/navigation.jsp" />
</div>
<div id="pagecell1">
<div id="breadCrumb">
<table width="100%" border="0">
<tr>
<% String requestURL= request.getRequestURI();
String param=request.getQueryString();
String hidAddr="/bookshop/MenuHidden?jspURL=" + requestURL +"¶m="+ param ;
String showAddr="/bookshop/MenuShow?jspURL=" + requestURL +"¶m="+ param ; %>
<td width="211"><a href=<%= hidAddr %> align="left">隱藏</a> / <a href=<%= showAddr %>>顯示</a> </td>
<td width="516"><div align="right"><a href="/bookshop/userLogin.jsp"align="right">登陸</a> | <a href="/bookshop/userRegister.jsp">新用戶注冊</a> | <a href="/bookshop/adminLogin.jsp">管理員入口</a></div></td>
</tr>
</table>
</div>
<table width="100%" border="0">
<tr valign="top">
<% if(session.getAttribute("hidden")==null){ %>
<jsp:include page="/utility/menu.jsp" />
<% } %>
<td width="81%" >
<div class="book">
<table width="100%" cellpadding="0" cellspacing="0" summary="">
<tr valign="top">
<td width="5%" > <p>
</p></td>
<% if(index+1<=booklist.size()){
BookInf book= (BookInf)booklist.elementAt(index);
String imgURL="source/"+book.getId()+".JPG";
String commentURL="/bookshop/bookComment.jsp?bookId="+book.getId();
String cartURL="/bookshop/addCart.jsp?bookId="+book.getId();
%>
<td width="23%" ><a href="#" onClick="window.open('<%= commentURL %>','s','width=850,height=600,scrollbars=yes,resizeable=yes,ststus=yes');"><img src=<%= imgURL %> width="135" height="200" border="0" ></a></td>
<td width="22%" ><p class="bookInfo">書名:<%= book.getName() %></p>
<p class="bookInfo">作者:<%= book.getAuthor() %></p>
<p class="bookInfo">出版社:<%= book.getPublisher() %></p>
<p class="bookInfo">類別:<%= book.getType() %></p>
<p class="bookInfo">單價:¥<%= book.getPrice() %></p>
<p class="bookInfo"><a href="#" onClick="window.open('<%= cartURL %>','s','width=300,height=300,scrollbars=yes,resizeable=yes,ststus=yes');"><img src="source/cart.gif" width="130" height="25" border="0"></a></p></td>
<% } else { %>
<td width="23%" height="200"> </td>
<td width="22%" height="200"> </td>
<% } %>
<td width="5%" > </td>
<% if(index+2<=booklist.size()){
BookInf book= (BookInf)booklist.elementAt(index+1);
String imgURL="source/"+book.getId()+".JPG";
String commentURL="/bookshop/bookComment.jsp?bookId="+book.getId();
String cartURL="/bookshop/addCart.jsp?bookId="+book.getId();
%>
<td width="23%" ><a href="#" onClick="window.open('<%= commentURL %>','s','width=850,height=600,scrollbars=yes,resizeable=yes,ststus=yes');"><img src=<%= imgURL %> width="135" height="200" border="0" ></a></td>
<td width="22%" ><p class="bookInfo">書名:<%= book.getName() %></p>
<p class="bookInfo">作者:<%= book.getAuthor() %></p>
<p class="bookInfo">出版社:<%= book.getPublisher() %></p>
<p class="bookInfo">類別:<%= book.getType() %></p>
<p class="bookInfo">單價:¥<%= book.getPrice() %></p>
<p class="bookInfo"><a href="#" onClick="window.open('<%= cartURL %>','s','width=300,height=300,scrollbars=yes,resizeable=yes,ststus=yes');"><img src="source/cart.gif" width="130" height="25" border="0"></a></p></td>
<% } else { %>
<td width="23%" height="200"> </td>
<td width="22%" height="200"> </td>
<% } %>
</tr>
<tr valign="top">
<td colspan="6" > <p>
</p> <p>
</p></td>
</tr>
<tr valign="top">
<td > </td>
<% if(index+3<=booklist.size()){
BookInf book= (BookInf)booklist.elementAt(index+2);
String imgURL="source/"+book.getId()+".JPG";
String commentURL="/bookshop/bookComment.jsp?bookId="+book.getId();
String cartURL="/bookshop/addCart.jsp?bookId="+book.getId();
%>
<td width="23%" ><a href="#" onClick="window.open('<%= commentURL %>','s','width=850,height=600,scrollbars=yes,resizeable=yes,ststus=yes');"><img src=<%= imgURL %> width="135" height="200" border="0" ></a></td>
<td width="22%" ><p class="bookInfo">書名:<%= book.getName() %></p>
<p class="bookInfo">作者:<%= book.getAuthor() %></p>
<p class="bookInfo">出版社:<%= book.getPublisher() %></p>
<p class="bookInfo">類別:<%= book.getType() %></p>
<p class="bookInfo">單價:¥<%= book.getPrice() %></p>
<p class="bookInfo"><a href="#" onClick="window.open('<%= cartURL %>','s','width=300,height=300,scrollbars=yes,resizeable=yes,ststus=yes');"><img src="source/cart.gif" width="130" height="25" border="0"></a></p></td>
<% } else { %>
<td width="23%" height="200"> </td>
<td width="22%" height="200"> </td>
<% } %>
<td > </td>
<% if(index+4<=booklist.size()){
BookInf book= (BookInf)booklist.elementAt(index+3);
String imgURL="source/"+book.getId()+".JPG";
String commentURL="/bookshop/bookComment.jsp?bookId="+book.getId();
String cartURL="/bookshop/addCart.jsp?bookId="+book.getId();
%>
<td width="23%" ><a href="#" onClick="window.open('<%= commentURL %>','s','width=850,height=600,scrollbars=yes,resizeable=yes,ststus=yes');"><img src=<%= imgURL %> width="135" height="200" border="0" ></a></td>
<td width="22%" ><p class="bookInfo">書名:<%= book.getName() %></p>
<p class="bookInfo">作者:<%= book.getAuthor() %></p>
<p class="bookInfo">出版社:<%= book.getPublisher() %></p>
<p class="bookInfo">類別:<%= book.getType() %></p>
<p class="bookInfo">單價:¥<%= book.getPrice() %></p>
<p class="bookInfo"><a href="#" onClick="window.open('<%= cartURL %>','s','width=300,height=300,scrollbars=yes,resizeable=yes,ststus=yes');"><img src="source/cart.gif" width="130" height="25" border="0"></a></p></td>
<% } else { %>
<td width="23%" height="200"> </td>
<td width="22%" height="200"> </td>
<% } %>
</tr>
<tr valign="top">
<td colspan="6" > <p>
</p> <p>
</p></td>
</tr>
<tr valign="top">
<td height="200" > </td>
<% if(index+5<=booklist.size()){
BookInf book= (BookInf)booklist.elementAt(index+4);
String imgURL="source/"+book.getId()+".JPG";
String commentURL="/bookshop/bookComment.jsp?bookId="+book.getId();
String cartURL="/bookshop/addCart.jsp?bookId="+book.getId();
%>
<td width="23%" ><a href="#" onClick="window.open('<%= commentURL %>','s','width=850,height=600,scrollbars=yes,resizeable=yes,ststus=yes');"><img src=<%= imgURL %> width="135" height="200" border="0" ></a></td>
<td width="22%" ><p class="bookInfo">書名:<%= book.getName() %></p>
<p class="bookInfo">作者:<%= book.getAuthor() %></p>
<p class="bookInfo">出版社:<%= book.getPublisher() %></p>
<p class="bookInfo">類別:<%= book.getType() %></p>
<p class="bookInfo">單價:¥<%= book.getPrice() %></p>
<p class="bookInfo"><a href="#" onClick="window.open('<%= cartURL %>','s','width=300,height=300,scrollbars=yes,resizeable=yes,ststus=yes');"><img src="source/cart.gif" width="130" height="25" border="0"></a></p></td>
<% } else { %>
<td width="23%" height="200"> </td>
<td width="22%" height="200"> </td>
<% } %>
<td height="200" > </td>
<% if(index+6<=booklist.size()){
BookInf book= (BookInf)booklist.elementAt(index+5);
String imgURL="source/"+book.getId()+".JPG";
String commentURL="/bookshop/bookComment.jsp?bookId="+book.getId();
String cartURL="/bookshop/addCart.jsp?bookId="+book.getId();
%>
<td width="23%" ><a href="#" onClick="window.open('<%= commentURL %>','s','width=850,height=600,scrollbars=yes,resizeable=yes,ststus=yes');"><img src=<%= imgURL %> width="135" height="200" border="0" ></a></td>
<td width="22%" ><p class="bookInfo">書名:<%= book.getName() %></p>
<p class="bookInfo">作者:<%= book.getAuthor() %></p>
<p class="bookInfo">出版社:<%= book.getPublisher() %></p>
<p class="bookInfo">類別:<%= book.getType() %></p>
<p class="bookInfo">單價:¥<%= book.getPrice() %></p>
<p class="bookInfo"><a href="#" onClick="window.open('<%= cartURL %>','s','width=300,height=300,scrollbars=yes,resizeable=yes,ststus=yes');"><img src="source/cart.gif" width="130" height="25" border="0"></a></p></td>
<% } else { %>
<td width="23%" height="200"> </td>
<td width="22%" height="200"> </td>
<% } %>
</tr>
<tr valign="top">
<td height="23" colspan="6" ><div align="center">
<p> </p>
<%
String aft="/bookshop/index.jsp?pg="+Integer.toString(index/6+2);
String pre="/bookshop/index.jsp?pg="+Integer.toString(index/6);
if(pg.equals("1")){
if(Integer.parseInt(pg)<pgSum){
%>
<p style="font:color=black">上一頁 共<%= pg %>/<%= pgSum %>頁 <a href=<%= aft %>><font color="black">下一頁 </font> </a></p>
<% }else{ %>
<tr valign="top">
<td height="23" colspan="6" ><div align="right">
<p>上一頁 共<%= pg %>/<%= pgSum %>頁 下一頁 </p>
<% }
} else {
if(Integer.parseInt(pg)<pgSum){
%>
<p ><a href=<%= pre %>><font color="black">上一頁</font></a> 共<%= pg %>/<%= pgSum %>頁 <a href=<%= aft %>><font color="black">下一頁</font> </a></p>
<% } else {
%>
<p><a href=<%= pre %>><font color="black">上一頁</font></a> 共<%= pg %>/<%= pgSum %>頁 下一頁</p>
<% }
} %>
</div></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<jsp:include page="/utility/copyRight.jsp" />
</div>
<br>
<jsp:include page="/utility/scriptMenuitem.jsp" />
</body>
<% } %>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -