<!--#include file="include/conn.asp"-->
<!--#include file="menu.asp"-->
<%
'如果购物车为空
If session("orderlst") = "" Then
Call alert("对不起,购物车为空.","/shopping1.asp")
End If

Dim Quatity,Sum
Dim ArrProId
ArrProId=split(session("orderlst"),",")

Dim aaaa,bbbb,cccc,dddd,eeee,ffff,gggg,hhhh,iiii,zzzz,uv,umm
Dim chicun,yanse,cpcp,yfff
chicun=Trim(request("chicun"))
yanse=Trim(request("yanse"))
aaaa=Trim(request("aaaa"))
bbbb=Trim(request("bbbb"))
cccc=Trim(request("cccc"))
dddd=Trim(request("dddd"))
eeee=Trim(request("eeee"))
ffff=Trim(request("ffff"))
gggg=Trim(request("gggg"))
hhhh=Trim(request("hhhh"))
iiii=Trim(request("iiii"))
zzzz=Trim(request("zongjia"))
cpcp=Trim(request("cpcp"))
yfff=Trim(request("yfff"))
If action="addorder" Then

	If Syou = 0 And session("userid")="" Then
		Call alert("对不起您不是会员，无法直接购买。\n请注册成会员之后再购买。","/UserCenter.asp?gaozhen=myinfo")
	ElseIf Syou = 1 And session("userid")="" Then
		'一个伟大的游客，竟然没有登录，而且网站管理员还设置了可以游客购买。
		oConn.Execute("INSERT INTO [LstOrder] (OProName,ONo,OPro,ONum,OName,OAddress,OTel,OZip,OEmail,OContent,OUserId,OState,OAddtime,OCCC,OYYY,Omoney,Ozongjia,OYun) VALUES ('"&cpcp&"','"&iiii&"','"&gggg&"','"&hhhh&"','"&aaaa&"','"&bbbb&"','"&cccc&"','"&dddd&"','"&eeee&"','"&ffff&"',0,0,now(),'"&chicun&"','"&yanse&"',0,'"&zzzz&"','"&yfff&"')")
	Else
		oConn.Execute("INSERT INTO [LstOrder] (OProName,ONo,OPro,ONum,OName,OAddress,OTel,OZip,OEmail,OContent,OUserId,OState,OAddtime,OCCC,OYYY,Omoney,Ozongjia,OYun) VALUES ('"&cpcp&"','"&iiii&"','"&gggg&"','"&hhhh&"','"&aaaa&"','"&bbbb&"','"&cccc&"','"&dddd&"','"&eeee&"','"&ffff&"','"&session("userid")&"',0,now(),'"&chicun&"','"&yanse&"',0,'"&zzzz&"','"&yfff&"')")
	End If
	session("orderlst") = ""
		Call backurl("/Shopping3.asp?ddbh="&iiii&"")
End If

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
%>
<!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>
<script src="/css/addorder.js" type="text/javascript"></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">
<form action="/Shopping2.asp?TT=<%=TT%>&action=addorder" name="order" method="post">
<table border="0" width="100%" cellspacing="1" style="border-collapse: collapse" height="145" >
<tr>
	<td colspan="7" bgcolor="#F3F0D6" height="34" align="left">&nbsp;&nbsp;&nbsp; 以下是您订购的商品：</td>
</tr>
<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="8%">
	<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>
</tr>
<%
Sum = 0
i=0
While Not oRs.EOF
Sum = Sum + ccur(oRs("PHmoney")) * Session(oRs("Id"))
%>
<tr>
	<td width="19%" bgcolor="#F3F5FC" align="center" height="60"><a href=/ProInfo.asp?Id=<%=oRs("Id")%>><img width="50" height="50" src="<%=oRs("PSmallPic")%>" border="0"></a><input name="cpcp" type="hidden" value="<%=oRs("PTitle")%>"></td>
	<td bgcolor="#F3F5FC" align="center" style="line-height:25px;" height="30" width="17%"><%=GZMONRY(oRs("PHmoney"))%></td>
	<td bgcolor="#F3F5FC" align="center" height="30" width="8%"><%If Session(ArrProId(i))="" Then%>1<%else%><%=Session("nn"&ArrProId(i)&"")%><%end if%></td>
	<td bgcolor="#F3F5FC" align="center" height="30" width="8%"><%If Session("cc"&ArrProId(i)&"")="" Then%>1<%else%><%=Session("cc"&ArrProId(i)&"")%><%end if%></td>
	<td bgcolor="#F3F5FC" align="center" height="30" width="8%"><%If Session("ys"&ArrProId(i)&"")="" Then%>1<%else%><%=Session("ys"&ArrProId(i)&"")%><%end if%></td>
	<td bgcolor="#F3F5FC" align="center" height="30" 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="30" 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>
</tr>
<%
TotalMoney=TotalMoney + zongjia
zTotalMoney=zTotalMoney + zZongjia
oRs.MoveNext
i=i+1
Wend
%>
<tr>
	<td colspan="7" bgcolor="#F3F0D6" height="34" align="center">
<script type="text/javascript">
function aa(){
YYYFFF.innerHTML=document.getElementById("yunfei").value;
document.getElementById("yfff").value = document.getElementById("yunfei").value
}
</script>

选择运费：<select onchange="aa();" name="yunfei">
<%If ssmm=0 Then%>
	<option value="0">卖家承担运费</option>
<%Else%>
	<option value="">买家承担运费</option>
	<%if Isarray(CYUN) Then%>
	<%for i=0 to UBound(CYUN,2)%>
	<option value="<%=CYUN(2,i)%>"><%=CYUN(1,i)%>,<%=CYUN(2,i)%>元</option>
	<%Next 
	End if%>
<%End If%>
</select>
运费：<span id="YYYFFF"></span>.00 元
</td>
</tr>
<tr>
	<td colspan="7" bgcolor="#F3F0D6" height="34" align="center">
	<%If session("userid")="" Then %><%Else%><span class="fred">折扣价:<%=GZMONRY(zTotalMoney)%>元</span> | <%End If%><b class="fblue">实际总计价: <%=GZMONRY(TotalMoney)%>元</b>
	<%If session("userid")="" Then%><input type=hidden name="zongjia" value="<%=TotalMoney%>"><%Else%><input type=hidden name="zongjia" value="<%=TotalMoney%>">
	<%End If%>

	<input type="hidden" id="yfff" name="yfff" value="0"></td>
</tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td colspan="5" bgcolor="#F3F0D6" height="34" align="left">&nbsp;&nbsp;&nbsp; 请先提交订单：</td>
</tr>
<tr bgcolor="#F3F3F5">
<td height="30" align="right" bgcolor="#FAFAFA"> 订单编号：</td>
<td height="30" align="left" bgcolor="#FAFAFA"><input disabled name="x" value="<%=getOrdernum()%>" /> <B class="fred">* 请牢记此订单号。</B>
<input name="iiii" type="hidden" value="<%=getOrdernum()%>" />
<input name="gggg" type="hidden" size="50" value="<%=session("orderlst")%>" />
<input name="hhhh" type="hidden" size="50" value="<%For i=0 to UBound(ArrProId)%><%=Session("nn"&ArrProId(i)&"")%>,<%next%>" />
<input name="chicun" type="hidden" size="50" value="<%For i=0 to UBound(ArrProId)%><%=Session("cc"&ArrProId(i)&"")%>,<%next%>" />
<input name="yanse" type="hidden" size="50" value="<%For i=0 to UBound(ArrProId)%><%=Session("ys"&ArrProId(i)&"")%>,<%next%>" />
</td>
</tr>
<tr bgcolor="#F3F3F5">
<td height="30" align="right" bgcolor="#FAFAFA"> 您的姓名：</td>
<td height="30" align="left" bgcolor="#FAFAFA"><input size="10" name="aaaa" type="text" value="<%If session("userid")="" Then%><%else%><%=Uid("UsrName")%><%End If%>" />
</td>
</tr>
<tr bgcolor="#F3F3F5">
<td height="30" align="right"> 送货地址：</td>
<td height="30" align="left">
<input name="bbbb" type="text" size="50" value="<%If session("userid")="" Then%><%else%><%=Uid("UsrAddress")%><%End If%>" /></td>
</tr>
<tr bgcolor="#FAFAFA">
<td height="30" align="right"> 您的电话：</td>
<td height="30" align="left"><input name="cccc" type="text" size="15" value="<%If session("userid")="" Then%><%else%><%=Uid("UsrTel")%><%End If%>" /></td>
</tr>
<tr bgcolor="#F3F3F5">
<td height="30" align="right"> 邮政编码：</td>
<td height="30" align="left"><input name="dddd" type="text" size="10" value="<%If session("userid")="" Then%><%else%><%=Uid("UsrZip")%><%End If%>" /></td>
</tr>
<tr bgcolor="#FAFAFA">
<td height="30" align="right">您的邮箱：</td>
<td height="30" align="left"><input name="eeee" type="text" size="30" value="<%If session("userid")="" Then%><%else%><%=Uid("UsrEmail")%><%End If%>" /></td>
</tr>
<tr bgcolor="#F3F3F5">
<td align="right">其他说明：</td>
<td align="left">
<textarea name="ffff" cols="50" rows="4"></textarea></td>
</tr>
<tr bgcolor="#F3F3F5">
<td align="right"></td>
<td align="left">
<input class="anlockblue" name="s" type="button" onClick="return check()"  value="确认订单"></td>
</tr>
</table>
</form>


	</div>
	</div>
	</div>
</div>
<!---版权部分--->
<div class="clear"></div>
<%Call HelpMenu()%>
<%Call ShowEnd()%>
</div>
</body>
</html>
