booklist.jsp
上传用户:tanyanyong
上传日期:2013-06-23
资源大小:1355k
文件大小:4k
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <%@ page import="java.util.*" %>
- <%@ page import="bookshop.book.bookclass" %>
- <%@ page session="true" %>
- <%@ page import="bookshop.book.book"%>
- <jsp:useBean id="book" scope="page" class="bookshop.book.book" />
- <jsp:useBean id="book_list" scope="page" class="bookshop.run.op_book" />
- <jsp:useBean id="classlist" scope="page" class="bookshop.run.op_bookclass" />
- <%
- int pages=1;
- String mesg = "";
- if (request.getParameter("page")!=null && !request.getParameter("page").equals("")) {
- String requestpage = request.getParameter("page");
- try {
- pages = Integer.parseInt(requestpage);
- } catch(Exception e) {
- mesg = "你要找的页码错误!";
- }
- book_list.setPage(pages);
- }
- %>
- <script language="javascript">
- function openScript(url,name, width, height){
- var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
- }
- </script>
- <%@include file="/bookshop/inc/head.inc"%>
- <%@include file="/bookshop/inc/sub.inc"%>
- <table width="778">
- <tr>
- <td width="150" align="center">
- <%@include file="/bookshop/inc/left.inc"%>
- </td>
- <td width="600">
- <p align="center"><b><font color="#0000FF">隽隽电子书店图书<%= classname %>列表</font></b></p>
- <%if (!keyword.equals("")) out.println("<p ><font color=#ff0000>你要查找关于 " + keyword + " 的图书如下</font></p>"); %>
- <table width="100%" border="1" cellspacing="1" cellpadding="1" bordercolor="white">
- <tr align="center" bgcolor="#DEF3CE">
- <td>图书名称</td>
- <td>作者</td>
- <td>图书类别</td>
- <td>出版社</td>
- <td>单价</td>
- <td width=110>选择</td>
- </tr>
- <% if (book_list.book_search(request)) {
- if (book_list.getBooklist().size()>0 ){
- for (int i=0;i<book_list.getBooklist().size();i++){
- book bk = (book) book_list.getBooklist().elementAt(i);%>
- <tr>
- <td><%= bk.getBookName() %></td>
- <td align="center"><%= bk.getAuthor() %></td>
- <td align="center"><%= bk.getClassname() %></td>
- <td align="center"><%= bk.getPublish() %></td>
- <td align="center"><%= bk.getPrince() %>元</td>
- <td align="center"><a href="#" onclick="openScript('buy.jsp?bookid=<%= bk.getId() %>','pur',300,250)" >购买</a>
- <a href="#" onclick="openScript('detail.jsp?bookid=<%= bk.getId() %>','show',400,500)" >详细资料</a></td>
- </tr>
- <% }
- }else {
- if (keyword.equals("")){
- out.println("<tr><td align='center' colspan=6> 暂时没有此类图书资料</td></tr>");
- } else {
- out.println("<tr><td align='center' colspan=6> 没有你要查找的 " + keyword + " 相关图书</td></tr>") ;
- }
- }
- } else {%>
- <tr>
- <td align="center" colspan=6> 数据库出错,请稍后</td>
-
- </tr>
- <% } %>
- </table>
- <table width="90%" border="0" cellspacing="1" cellpadding="1">
- <tr>
- <td align="right">总计结果为<%= book_list.getRecordCount() %>条,当前页第<%= book_list.getPage() %>页 <a href="booklist.jsp?classid=<%= classid%>&keyword=<%= keyword %>">首页</a>
- <% if (book_list.getPage()>1) {%>
- <a href="booklist.jsp?page=<%= book_list.getPage()-1 %>&classid=<%= classid%>&keyword=<%= keyword %>">上一页</a>
- <% } %>
- <% if (book_list.getPage()<book_list.getPageCount()-1) {%>
- <a href="booklist.jsp?page=<%= book_list.getPage()+1 %>&classid=<%= classid%>&keyword=<%= keyword %>">下一页</a>
- <% } %>
- <a href="booklist.jsp?page=<%= book_list.getPageCount() %>&classid=<%= classid%>&keyword=<%= keyword %>">未页</a> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <%@include file="/bookshop/inc/tail.inc"%>