?? searchbookresult.jsp
字號:
<%@ page language="java" pageEncoding="gb2312"%>
<%@ page import="java.util.ArrayList,java.util.Iterator"%>
<%@ page import="common.Format,bean.BookBean"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>圖書搜索結果</title>
<%!ArrayList list = null;%>
</head>
<body>
<center>
<table>
<tr>
<td>
<jsp:include page="top.jsp" />
</td>
</tr>
<tr align=right>
<td>
<jsp:include page="advertise.jsp" />
</td>
</tr>
</table>
</center>
<form action=searchBook method=post>
<table border=0 bordercolor="green" align=center>
<tr>
<td>
<strong>查詢圖書</strong>
</td>
<td>
書名:
<input type="text" name=bookName style="width:100">
</td>
<td>
作者:
<input type="text" name=author style="width:100">
</td>
<td>
出版社:
<input type="text" name=publisher style="width:100">
</td>
<td>
類型:
<select name=bookType>
<option value='' selected>
所有
</option>
<option value="小說">
小說
</option>
<option value="計算機">
計算機
</option>
<option value="經濟管理">
經濟管理
</option>
<option value="認證考試">
認證考試
</option>
<option value="大學教程">
大學教程
</option>
<option value="機械工程">
機械工程
</option>
<option value="期刊雜志">
期刊雜志
</option>
<option value="其它書藉">
其他書籍
</option>
</select>
</td>
<td>
<input type="submit" value="搜索">
</td>
</tr>
</table>
</form>
<%
if (session.getAttribute("bookList") != null) {
list = (ArrayList) session.getAttribute("bookList");
Iterator it = list.iterator();
if (it.hasNext()) {
BookBean book;
%>
<table border=1 width=80% bordercolor=green align=center>
<caption>
<font style="font-size:17pt;font-style:italic">搜尋結果</font>
</caption>
<tr align=center>
<th>
封面
</th>
<th>
書名
</th>
<th>
作者
</th>
<th>
原價
</th>
<th>
折扣價
</th>
<th width="60pt">
<a href="checkCart">購物車</a>
</th>
</tr>
<%
int i = 0;
while (it.hasNext()) {
book = (BookBean) it.next();
i++;
%>
<tr align=center>
<td>
<img src=<%=book.getBookView()%> width=60 height=90>
</td>
<td>
<%=book.getBookName()%>
</td>
<td>
<%=book.getAuthor()%>
</td>
<td>
<strike> <%=Format.numFormat(book.getPrice())%> </strike>
</td>
<td>
<font color=brown><%=Format.numFormat(book.getPriceDiscount())%>
</font>
</td>
<td>
<form action="checkCart" method="post">
<input type="hidden" name="bookID" value=<%=book.getBookID()%>>
<input type="hidden" name="bookName"
value=<%=book.getBookName()%>>
<input type="hidden" name="price" value=<%=book.getPrice()%>>
<input type="hidden" name="priceByOff"
value=<%=book.getPriceDiscount()%>>
<input type="hidden" name="bookView"
value=<%=book.getBookView()%>>
<input type=submit value="購買">
</form>
</td>
</tr>
<%
}
%>
</table>
<%
} else {
out.println("<center><font color=brown>抱歉,沒有您要找的書。</font></center>");
}
}
%>
<jsp:include page="bottom.txt" />
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -