⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shoppingcar.jsp

📁 一个购物网站
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@page import="java.net.URLEncoder.*"%>
<%@page import="java.io.*"%>
<%@page import="java.lang.*"%>
<%@page import="java.util.*"%>
<%@page import="shoppingCar.*"%>

<HTML>
<HEAD>
<TITLE>游戏天地</TITLE>

<SCRIPT language=JavaScript1.2>
<!--
function listdiv(str)
{
	if(str=='xh')
	{
		xh.style.visibility = "visible";
		lp.style.visibility = "hidden";
		gwzn.style.visibility = "hidden";
		wzdd.style.visibility = "hidden";
		hyfw.style.visibility = "hidden";
	}
	if(str=='lp')
	{
		xh.style.visibility = "hidden";
		lp.style.visibility = "visible";
		gwzn.style.visibility = "hidden";
		wzdd.style.visibility = "hidden";
		hyfw.style.visibility = "hidden";
	}
	if(str=='gwzn')
	{
		xh.style.visibility = "hidden";
		lp.style.visibility = "hidden";
		gwzn.style.visibility = "visible";
		wzdd.style.visibility = "hidden";
		hyfw.style.visibility = "hidden";
	}
	if(str=='wzdd')
	{
		xh.style.visibility = "hidden";
		lp.style.visibility = "hidden";
		gwzn.style.visibility = "hidden";
		wzdd.style.visibility = "visible";
		hyfw.style.visibility = "hidden";
	}
	if(str=='hyfw')
	{
		xh.style.visibility = "hidden";
		lp.style.visibility = "hidden";
		gwzn.style.visibility = "hidden";
		wzdd.style.visibility = "hidden";
		hyfw.style.visibility = "visible";
	}
}
function hiddendiv(str)
{
	eval(str).style.visibility = "hidden";
}
-->
</SCRIPT>

<SCRIPT language=JavaScript type=text/JavaScript>
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</SCRIPT>

<STYLE type=text/css>
@import url("images/style.css");

.a1 {FONT-SIZE: 12px; FILTER: glow(Color=#000000, strength=1); WIDTH: 6%; CURSOR: hand; LINE-HEIGHT: 150%; FONT-FAMILY: "宋体"}
.a2 {FONT-SIZE: 12px; FILTER: glow(Color=#000000, strength=1); WIDTH: 8%; CURSOR: hand; LINE-HEIGHT: 150%; FONT-FAMILY: "宋体"}
.a3 {FONT-SIZE: 12px; FILTER: glow(Color=#000000, strength=1); WIDTH: 10%; CURSOR: hand; LINE-HEIGHT: 150%; FONT-FAMILY: "宋体"}
body {
	background-image: url(<%=request.getContextPath()%>/images/background.png);
	background-repeat: repeat;
	background-image: url(images/index_bg.gif);
	margin-top: 0px;
}
</STYLE>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	font-size: 18px;
	font-weight: bold;
}
.style2 {color: #000000}
-->
</style>
</HEAD>

<BODY>

	<!--最外层的表格-->
	<table cellspacing="0" cellpadding="0" width="750" height="600" border="0" align="center">
		<tr>
			<td width="750" align="left" valign="top">
				<!-------------------------------------载有logo部分的表格----------------------------------------->
				<table width="100%" height="100" border="0" align="center" cellpadding="0" cellspacing="0">
      				<tr>
        				<td align="left" valign="top"><a href="<%=request.getContextPath()%>/index.jsp"><img src="<%=request.getContextPath()%>/images/top_bg.gif" name="logo" width="750" height="100" border="0" id="logo"></a></td>
      				</tr>
    			</table>
				<!-------------------------------------顶部横菜单部分的表格--------------------------------------->
      			<TABLE height="30" cellspacing="0" cellpadding="0" width="100%" align="center" background=   "<%=request.getContextPath()%>/images/top_menubg.gif" border="0">
  					<TR bgcolor="#453F3F">
    					<TD width="100" height="30" align="left">&nbsp;</TD> 
    					<TD width="420" height="30" align="left" valign="middle" class="text2">
	  					  <span style="color: #FFFFFF"><FONT style="FONT-WEIGHT: bold">
						<A href="<%=request.getContextPath()%>/index.jsp"><font color="#FFFFFF">
						首页</font></A>-
	
						
	
						<A href="<%=request.getContextPath()%>/logout.jsp"><font color="#FFFFFF">注销</font></A>- 
	
						 
	
						<A href="<%=request.getContextPath()%>/shoppingCar.jsp"><font color="#FFFFFF">
						购物车</font></A>-
	
						 
	
						<A href="<%=request.getContextPath()%>/shoppingGuide.jsp"><font color="#FFFFFF">
						本店宗旨</font></A>-
	
						 
	
						<A href="<%=request.getContextPath()%>/paymentExplain.jsp"><font color="#FFFFFF">
						购物流程</font></A>- 
	
						  
	
						<A href="storeManagedIndex.jsp"><font color="#FFFFFF">
						管理员登陆</font></A> - 
	
						
	
						<A href="<%=request.getContextPath()%>/aboutUs.jsp"><font color="#FFFFFF">
						个人资料</font></A> </FONT></span> </TD>
					    <TD width="180" align="middle">
						<FONT class="text0">
      						<DIV class="text0" id="jnkc"><!-- 时间显示 -->
      						<SCRIPT language="JavaScript" type="text/javascript">
	  						setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
	  						</SCRIPT>
      						</DIV>
					  </FONT>					  </TD>
	  
    					<TD width="50" height="30" align="right">&nbsp;</TD>
					</TR>
			  </TABLE>
		  		<!-----------------------------------------------中间部分的表格-------------------------------------------------->
		  		<table width="100%" height="400" border="0" align="center" cellpadding="0" cellspacing="0" background="images/storeManagedIndex_bg.gif">
            		<tr>
           			  <td height="400" align="center" valign="top" >
					  		<br>
							<br>
					  		<br>
							<span class="text3 STYLE1"><span class="STYLE1">您的购物车</span></span><br>							<br>
								<br><br>

								<%	double totalPrices=0;%>
								<%	String userName=(String)session.getAttribute("userName");	%>	
								<%	if(userName==null){	//尚未登录%>
										对不起,您尚未登录!登录后才能购买商品<br><br>										
										<a href="<%=request.getContextPath()%>/index.jsp">【登录】</a><br>
								<%	}else{	//已经登录%>
								<%		ArrayList goodsArraylist=null;	%>
								<%		Hashtable goodsHashtable=null;	%>
								<%		goodsArraylist=(ArrayList)session.getAttribute("goods");	%>
								<%		if(goodsArraylist==null||goodsArraylist.isEmpty()){	//尚未购买商品	%>
											您尚未选购任何商品,购物车为空!<br><br>		
											现在就去→<a href="<%=request.getContextPath()%>/main.jsp">购买</a><br>
								<%		}else{	%>
								<table width="500" border="1" cellpadding="5" cellspacing="0" bordercolor="#453F3F">
									<tr>
										<td width="100" height="20" align="center" bgcolor="#453F3F"><span class="text0">商品序号</span></td>
										<td width="120" height="20" align="center" bgcolor="#453F3F"><span class="text0">商品名称</span></td>
										<td width="100" height="20" align="center" bgcolor="#453F3F"><span class="text0">商品价格</span></td>
										<td width="100" height="20" align="center" bgcolor="#453F3F"><span class="text0">选购数量</span></td>
										<td width="80"  height="20" align="center" bgcolor="#453F3F"><span class="text0">操作</span></td>
									</tr>
									<%		for(int i=0;i<goodsArraylist.size();i++){	%>	
									<tr>
								<%			goodsHashtable=(Hashtable)goodsArraylist.get(i);	%>
								<%			String goodId=(String)goodsHashtable.get("goodId");
											String goodName=goodsHashtable.get("goodName").toString();
											String goodPrice=goodsHashtable.get("goodPrice").toString();											;
												   goodPrice=goodPrice.substring(0,goodPrice.length());
											String goodAmount=goodsHashtable.get("tradeTimes").toString();	
											String goodDisposal="删除";
								%>		
										<td align="center" width="100"  height="20"><%=new String(goodId.getBytes("GBK"))%></td>
										<td align="center" width="120" height="20"><%=new String(goodName.getBytes("GBK"))%></td>
										<td align="center" width="100" height="20"><%=goodPrice%>(元)</td>
										<td align="center" width="100" height="20"><%=goodAmount%></td>
										<td align="center" width="80"  height="20">
											<a href="<%=request.getContextPath()%>/DeleteOneAction?goodId=<%=goodId%>" class="style2">
											<%=new String(goodDisposal.getBytes("GBK"))%></a>
										</td>	
									</tr>
								<%			double singlePrice=90;		%>
								<%			int singleCount;	%>	
								<%			singlePrice=Double.parseDouble(goodsHashtable.get("goodPrice").toString());	%>
	   							<%			singleCount=Integer.parseInt(goodAmount);	%>
								<%			totalPrices=totalPrices+singlePrice*singleCount;%>
								<%			}	%>
									<tr >
										<td align="center" height="20" colspan="5">总计:<%=totalPrices%>(元)</td>
									</tr>
									<tr>
										<td height="20" colspan="5" align="right" valign="middle">
										
		<a href="<%=request.getContextPath()%>/DeleteAllAction">
		<IMG src="<%=request.getContextPath()%>/images/04shop_ClearCart.gif" width="87" height="21" border="0" >		</a>
		<a href="<%=request.getContextPath()%>/main.jsp">
		<IMG src="<%=request.getContextPath()%>/images/04shop_continueshop.gif" width="87" height="21" border="0" >		</a>
										
		<a href="<%=request.getContextPath()%>/PayAction?totalPrices=<%=totalPrices%>">
		<IMG src="<%=request.getContextPath()%>/images/04shop_checkout.gif" align=absMiddle border="0" >		</a></td>
										
										
									</tr>
						</table>
								<%		}	%>
								<%	}	%>							<br>					  
					  </td>
       			  </tr>
  		      </table>
	  				<!-----------------------------------------------------底部横菜单部分的表格-------------------------------------------->
      				<table height="89" width=100% cellSpacing=0 cellPadding=0  align="center"  border=0>
        				
						<TR>
						  <TD height="41" align="center"  class=text2 style5 style4><img src="images/menu_down2.gif" width="749" height="42"></TD>
					  </TR>
						<TR>
          					
          					<TD width=776 height="48" align="center" bgcolor="#453F3F" class=text2 style5 style4>
		  					    <A href="<%=request.getContextPath()%>/default.jsp"><font color="#FFFFFF"> 首 页</font></A> -
		  					    <A href="<%=request.getContextPath()%>/default.jsp"><font color="#FFFFFF"> 购物车</font></A> - 
		  					    <A href="<%=request.getContextPath()%>/default.jsp"><font color="#FFFFFF">购物帮助</font></A> - 
		  					    <A href="<%=request.getContextPath()%>/default.jsp"><font color="#FFFFFF"> 支付说明</font></A> - 
		  					    <A href="<%=request.getContextPath()%>/default.jsp"><font color="#FFFFFF"> 联系我们</font></A>
                            </TD>
          					
        				</TR>
			  </TABLE>
	  				<!--------------------------------------------------------底部网站信息--------------------------------------------------->
      				<table width="100%" height="80" border="0" cellpadding="0" cellspacing="0">
        				<tr>
          				  <td align="center" valign="middle" >		  					
							<p align="center" class="style6">游戏天地 精品游戏<BR>
            				  地址:成都信息工程学院航空港   邮编:610225<BR>
            				电话:028-85967449  Email:lxcliz@163.com <BR>
            				</p>	  					  
						  </td>
        				</tr>
      				</table>
  		  </td>
	  </tr>
</table>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -