<!--#include file="include/conn.asp"-->
<!--#include file="menu.asp"-->
<%
Dim Quatity,Sum
Dim ArrProId,ArrnProId
ArrProId=split(session("orderlst"),",")
'清空购物车
If action="clear" Then
	Session.Abandon()
	session("orderlst") = ""
	Call backurl("/Shopping1.asp")
end if
'修改数量
If action="xgnum" Then
session("orderlst") = ""
session("orderlst") = replace(Request("cpbm"),", ",",")
session("orderlst") = NewOrder(session("orderlst"))
ArrProId=split(session("orderlst"),",")
For i=0 to UBound(ArrProId)
	Session("nn"&ArrProId(i)) = Request("Q_"&ArrProId(i))
	Session("cc"&ArrProId(i)) = Request("C_"&ArrProId(i))
	Session("ys"&ArrProId(i)) = Request("Y_"&ArrProId(i))
next
	call backurl("/Shopping1.asp")
end If
'读取商品信息
If session("orderlst") <> "" Then
Set oRs=server.createobject("adodb.recordset")
sSql = "Select * From [LstPro]"
sSql = sSql& " Where Id in( " & session("orderlst") & ") order by id desc"
oRs.open sSql,oConn,3,3
End if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<!---通用配置--->
<title>我的购物车_<%=sWeb("WebTitle")%>_<%=sWeb("WebUrl")%>_Powered by www.gaozhen.name QQ_47329193</title>
<meta name="keywords" content="<%=sWeb("WebKeyWord")%>" />
<meta name="description" content="<%=sWeb("WebDescription")%>" />
<meta name="author" content="<%=sWeb("WebAuthor")%>" />
<meta name="copyright" content="<%=sWeb("WebCopyright")%>" />
<meta content="all" name="robots" />
<link rel="shortcut icon" href="/include/favicon/favicon.ico" />
<link rel="icon" href="/include/favicon/favicon.gif" type="image/gif" >
<link type="text/css" href="/include/css/global.css" rel="stylesheet" />
<script type="text/javascript" src="/include/Js/config.js"></script>
<!---网站配置--->
<link type="text/css" href="/css/style.css" rel="stylesheet" />
</head>
<body>
<%Call TopMenu()%>
<%Call HeadMenu()%>
<div id="maindiv">
<!---主体部分--->
<div id="lstpro">
	<div id="lstleft">
	<!--#include file="Leftpro.asp"-->
	</div>
	<div id="lstright">
	<div id="rrfff">
	<div class="sgohome">您现在的位置：首页 >> 我的购物车</div>
	<div class="stitle"><h1>我的购物车 -（注：折扣价 = 市场价 * 折扣 如果折扣价高于会员价，按会员价计算。）</h1></div>
	<div class="scont">

<table border="0" width="100%" cellspacing="1" style="border-collapse: collapse" onmousemove="showprice();">
<tr>
	<td height="31" width="19%" align="center" bgcolor="#840700">
	<font color="#FFFFFF"><b>产品名称</b></font></td>
	<td height="31" align="center" bgcolor="#840700" width="17%">
	<font color="#FFFFFF"><b>会员价格</b></font></td>
	<td height="31" align="center" bgcolor="#840700" width="8%">
	<font color="#FFFFFF"><b>数量</b></font></td>
	<td height="31" align="center" bgcolor="#840700" width="18%">
	<font color="#FFFFFF"><b>市场价格</b></font></td>
	<td height="31" align="center" bgcolor="#840700" width="28%">
	<font color="#FFFFFF"><b>合计价格</b></font></td>
	<td height="31" align="center" bgcolor="#840700" width="9%">
	<font color="#FFFFFF"><b>选择</b></font></td>
</tr>
<%If session("orderlst") = "" Then%>
<tr>
	<td colspan="6" bgcolor="#F3F0D6" height="30" align="center">对不起，目前购物车没有任何产品。</td>
</tr>
<%else%>
<form action="/Shopping1.asp?action=xgnum" method="post">
<%
Sum = 0
i=0
While Not oRs.EOF
Sum = Sum + ccur(oRs("PHmoney")) * Session(oRs("Id"))
If Session(ArrProId(i))="" Then Session(ArrProId(i))=1
%>
<tr>
	<td width="19%" bgcolor="#F3F5FC" align="center" height="132"><a href=/ProInfo.asp?Id=<%=oRs("Id")%>><img width="100" height="100" src="<%=oRs("PSmallPic")%>" border="0"></a></td>
	<td bgcolor="#F3F5FC" height="132" width="17%" align="center" style="line-height:25px;">
	<%=GZMONRY(oRs("PHmoney"))%><br>
	尺寸：<input class="ordernum" Name="<%="C_"&ArrProId(i)%>" Value="<%If Session("cc"&ArrProId(i)&"")="" Then%>1<%else%><%=Session("cc"&ArrProId(i)&"")%><%end if%>" size="4"><br>
	颜色：<input class="ordernum" Name="<%="Y_"&ArrProId(i)%>" Value="<%If Session("ys"&ArrProId(i)&"")="" Then%>1<%else%><%=Session("ys"&ArrProId(i)&"")%><%end if%>" size="4"></td>
	<td bgcolor="#F3F5FC" align="center" height="132" width="8%">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td><input onclick="{location.href='?action=jia&pppid=<%=ArrProId(i)%>';}"  style="width:20px;height:20px;border:1px #AB0000;color:#fff;background:#AB0000;" name=s type=button value="+"></td>
			<td><input onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" class="ordernum" Name="<%="Q_"&ArrProId(i)%>" Value="<%If Session("nn"&ArrProId(i)&"")="" Then%>1<%else%><%=Session("nn"&ArrProId(i)&"")%><%end if%>" style="width:20px;height:20px;border:1px #AB0000;color:#000;background:#fff;"></td>
			<td><input style="width:20px;height:20px;border:1px #AB0000;color:#fff;background:#AB0000;" onclick="{location.href='?action=jian&pppid=<%=ArrProId(i)%>';}" name=s type=button value="-"></td>
		</tr>
	</table>
	</td>
	<td bgcolor="#F3F5FC" align="center" height="132" width="18%" style="line-height:25px;">
	<%If session("userid")="" Then %><%Else%><span class="fred">折扣价：<%=GZMONRY(int(oRs("PSmoney")*Mzhe/10))%></span><br><%End If%>市场价：<%=GZMONRY(oRs("PSmoney"))%></td>
	<td bgcolor="#F3F5FC" align="center" height="132" width="28%" style="line-height:25px;"><%
	  dim zongjia,TotalMoney,zZongjia,zTotalMoney
	  zongjia=oRs("PHmoney")*Session("nn"&ArrProId(i)&"")
	  '会员享受的价格
	  If session("userid")="" Then
	  zZongjia = 0
	  Else
	  zZongjia=int(oRs("PSmoney")*Mzhe/10)*Session("nn"&ArrProId(i)&"")
	  End If
	  %>
	  <%If session("userid")="" Then %><%Else%><span class="fred"><%=GZMONRY(zZongjia)%></span><br><%End If%><%=GZMONRY(Zongjia)%></td>
	<td bgcolor="#F3F5FC" align="center" height="132" width="9%"><input type="checkbox" style="display:none" id="<%=oRs(0)%>" name= "cpbm" value="<%=oRs(0)%>" checked><input style="width:20px;height:20px;border:1px;color:#fff;background:#999999;" onmouseover="chk(<%=oRs(0)%>);" onmouseout="chk2(<%=oRs(0)%>);" name="rwe" type=submit value="删"></td>
</tr>
<%
TotalMoney=TotalMoney + zongjia
zTotalMoney=zTotalMoney + zZongjia
oRs.MoveNext
i=i+1
Wend
%>
<tr>
	<td colspan="6" bgcolor="#F3F0D6" height="30" align="center"><%If session("userid")="" Then %><%Else%><span class="fred">折扣价：<%=GZMONRY(zTotalMoney)%></span> <%End If%><b class="fblue">实际总计价： <%=GZMONRY(TotalMoney)%></b>(按低价计算)</td>
</tr>

<%End If%>
<tr>
	<td colspan="6" bgcolor="#F3F0D6" height="30" align="center">
	<input type=image src ="/images/xg1.gif" name="B1">
	<a href="/Shopping1.asp?action=clear"><img border="0" src="/images/xg2.gif"></a>
	<a href="/ProClassBig.asp"><img border="0" src="/images/xg4.gif"></a>
	<a href="/Shopping2.asp"><img border="0" src="/images/xg3.gif"></a></td>
</tr>
</form>
</table>

	</div>
	</div>
	</div>
</div>
<!---版权部分--->
<div class="clear"></div>
<%Call HelpMenu()%>
<%Call ShowEnd()%>
</div>
</body>
</html>
<script>
function chk(id)
{
document.getElementById(id).checked = false;
} 
function chk2(id)
{
document.getElementById(id).checked = true;
} 
</script>
<%
Dim pppid
pppid=Trim(request("pppid"))
'修改数量
If action="jia" Then
Session("nn"&pppid)=Session("nn"&pppid)+1
Call backurl("/Shopping1.asp")
end If

If action="jian" Then
If Session("nn"&pppid)<=1 Then 
	Call alert("对不起,数量不能小于1个","/Shopping1.asp")
Else
	Session("nn"&pppid)=Session("nn"&pppid)-1
	Call backurl("/Shopping1.asp")
End If
end If
%>