collection.jsp
资源名称:shop.rar [点击查看]
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:4k
源码类别:
Applet
开发平台:
Java
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.Iterator" errorPage="" %>
- <jsp:useBean id="book" scope="page" class="MyFly.Book.bookmn" />
- <jsp:useBean id="bookCollect" scope="page" class="MyFly.Book.bookCollect" />
- <jsp:useBean id="bookCollects" scope="page" class="MyFly.Book.bookCollects" />
- <%@ page import="MyFly.Book.Books" %>
- <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>
- <HTML>
- <HEAD>
- <TITLE>-收藏箱-</TITLE>
- <META http-equiv=Content-Type content="text/html; charset=gb2312">
- <META content=index,follow name=Robots>
- <LINK href="../image/buyok_shop.css" type=text/css rel=stylesheet>
- <META content="MSHTML 6.00.2900.3086" name=GENERATOR></HEAD>
- <BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 >
- <%
- String mesg="";
- String bookid=request.getParameter("bookid");
- String userid = (String) session.getAttribute("userid");
- if(userid==null)
- {
- out.println("<Script language=JavaScript>alert('您还没登录,您无权收藏');javascript:window.close();</Script>");
- }
- else
- {
- if (!book.getOnebook(bookid)){
- mesg = "你要购买的图书不存在!";
- out.println("<Script language=JavaScript>alert('"+mesg+"');javascript:history.back();</Script>");
- }
- else
- {
- Books bk = (Books) book.getBooklist().elementAt(0);
- bookCollect.setUserid(userid);
- bookCollect.setBookid(bk.getProductID());
- bookCollect.setBookname(bk.getProductName());
- %>
- <TABLE cellSpacing=0 cellPadding=0 width=630 align=center border=0>
- <TBODY>
- <TR>
- <TD height=50><BR> <FONT
- color=#ff3333><B>您选择的图书已经放入收藏箱,收藏箱中的图书将永久保存,除非您主动删除。</B></FONT><BR></TD></TR>
- <TR>
- <TD>
- <TABLE cellSpacing=1 cellPadding=4 width=567 align=center bgColor=#cccccc
- border=0>
- <FORM name=check action=collupdate.jsp method=post>
- <TR bgColor=#ffffff>
- <TD align="center" width=60 height=25><FONT color=#b0266d>选择</FONT></TD>
- <TD align="center" width=120><FONT color=#b0266d>商 品 编 号</FONT></TD>
- <TD align="center" width=340><FONT color=#b0266d>商 品 名 称</FONT></TD>
- <TD align="center" width=170><FONT color=#b0266d>购 买</FONT></TD></TR>
- <%
- if(bookCollect.setBookCollect()==1)
- {
- out.println("<Script language=JavaScript>alert('您已经收藏过此图书');javascript:window.close();</Script>");
- }
- else{
- bookCollects.setUserno(userid);
- bookCollects.getQueryBook();
- int item=bookCollects.getItems();
- System.out.print(item);
- for(int i=0; i<item; i++)
- {
- %>
- <TR bgColor=#ffffff>
- <TD align="center"height=20><INPUT type=checkbox CHECKED
- value="<%= bookCollects.getBookid(i)%>" name=ProdId></TD>
- <TD align="center"><%= bookCollects.getBookid(i)%> </TD>
- <TD> <FONT color=#b0266d><%= bookCollects.getBookname(i) %></FONT></TD>
- <TD align="center"><A href="#" onClick="openScript('../purchasecart.jsp?bookid=<%= bookCollects.getBookid(i)%>','pur',650,300)">放入购物车</A></TD></TR>
- <%}}%>
- <TR>
- <TD bgColor=#ffffff colSpan=4 height=40><FONT
- color=red>注意:若要删除收藏箱中的图书,请去掉图书前的小勾,再单击“更新收藏”。</FONT> </TD></TR>
- <TR bgColor=#ffffff>
- <TD vAlign="middle" align="center" colSpan=4 height=40>
- <INPUT type=submit value=更新收藏箱 name=fav>
-
- <INPUT onclick=javascript:window.close() type=button value="继续购物" name=button>
- </TD></TR></FORM></TABLE></TD></TR></TBODY></TABLE>
- <%}
- }%>
- </BODY></HTML>