detail.jsp
上传用户:sxlinghang
上传日期:2022-07-20
资源大小:1405k
文件大小:3k
源码类别:

数据库编程

开发平台:

Java

  1. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  2. <%@ page session="true" %>
  3. <%@ page import="bookshop.book.book" %>
  4. <%@ page import="bookshop.util.dataFormat" %>
  5. <jsp:useBean id="book" scope="page" class="bookshop.run.op_book" />
  6. <%
  7. String mesg = "";
  8. int Id=0;
  9. if (request.getParameter("bookid")==null || request.getParameter("bookid").equals("")) {
  10. mesg = "你要查看的图书不存在!";
  11. } else {
  12. try {
  13. Id = Integer.parseInt(request.getParameter("bookid"));
  14. if (!book.getOnebook(Id)){
  15. mesg = "你要查看的图书不存在!";
  16. }
  17. } catch (Exception e){
  18. mesg = "你要查看的图书不存在!";
  19. }
  20. }
  21. %>
  22. <html>
  23. <head>
  24. <title>隽隽书店在线 查看图书资料</title>
  25. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  26. <script language="javascript">
  27. function check()
  28. {
  29. if (document.form1.amount.value<1){
  30. alert("你的购买数量有问题");
  31. document.form1.amount.focus();
  32. return false;
  33. }
  34. return true;
  35. }
  36. </script>
  37. <link rel="stylesheet" href="books.css" type="text/css">
  38. </head>
  39. <body bgcolor="#FFCC99" text="#000000" >
  40. <div align="center">
  41.   <p>隽隽书店欢迎你<font color="#CC0066">选购图书</font>!</p>
  42.   <% if(!mesg.equals("")){
  43. out.println(mesg);
  44.   } else {
  45. book bk = (book) book.getBooklist().elementAt(0);
  46.   
  47. %>
  48.   <table width="90%" border="0" cellspacing="2" cellpadding="1">
  49.     <form name="form1" method="post" action="buy.jsp">  
  50.       <tr> 
  51.         <td align="right" width="120">图书名:</td>
  52.         <td><%= bk.getBookName() %></td>
  53.       </tr>
  54.       <tr> 
  55.         <td align="right" width="120">作者:</td>
  56.         <td><%= bk.getAuthor() %></td>
  57.       </tr>
  58.       <tr> 
  59.         <td align="right" width="120">所属类别:</td>
  60.         <td><%= bk.getClassname() %></td>
  61.       </tr>
  62.       <tr> 
  63.         <td align="right" width="120">出版社:</td>
  64.         <td><%= bk.getPublish() %></td>
  65.       </tr>
  66.       <tr> 
  67.         <td align="right" width="120">书号:</td>
  68.         <td><%= bk.getBookNo() %></td>
  69.       </tr>
  70.       <tr> 
  71.         <td align="right" width="120">书价:</td>
  72.         <td><%= bk.getPrince() %></td>
  73.       </tr>
  74.       <tr> 
  75.         <td align="right" width="120">封面:</td>
  76.         <td ><img src="<%= bk.getPicture()%>" width="80" height="112"></td> 
  77.        </tr>
  78.       <tr>       
  79.         <td align="right" width="120" valign="top">内容介绍:</td>
  80.         <td><%= dataFormat.toHtml(bk.getContent()) %></td>
  81.       </tr>
  82.       <tr> 
  83.         <td align="right" width="120" valign="top">&nbsp;</td>
  84.         <td>&nbsp;</td>
  85.       </tr>
  86.       <tr> 
  87.         <td align="right" width="120" valign="top">购买:</td>
  88.         <td> 
  89.           <input type="text" name="amount" maxlength="5" size="3" value="1">
  90.           本</td>
  91.       </tr>
  92.       <tr> 
  93.         <td align="right" width="120" valign="top">&nbsp;</td>
  94.         <td> 
  95.   <input type="hidden" name="bookid" value="<%=Id %>" >
  96.           <input type="submit" name="Submit" value="购买" onclick="return(check());">
  97.           <input type="reset" name="reset" value="取消">
  98.         </td>
  99.       </tr>
  100.     </form>
  101.   </table>
  102. <% } %>
  103.   <br><p><a href="javascript:window.close()">关闭窗口</a></p>
  104.   <table width="100%" border="0" cellspacing="2" cellpadding="2">
  105.     <tr>
  106.       <td align="center">隽隽书店在线<br>
  107.         CopyRight@2004 <br>
  108.         Email:<a href="mailto:wxy8108123@163.com">wxy8108123@163.com</a></td>
  109.     </tr>
  110.   </table>
  111.   
  112. </div>
  113. </body>
  114. </html>