📄 cart_ordersave.asp
字号:
<!--#include file="Conn.asp"-->
<!--#include file="include/MyRequest.asp" -->
<!--#include file="include/nosql.asp" -->
<!--#include file="include/base64.asp"-->
<!--#include file="include/md5.asp"-->
<!--#include file="include/AliPayTo.asp"-->
<!--#include file="include/NetPay.asp"-->
<%
Sub PutToShopBag( add, x )
p=split(x,",")
If Len(x) = 0 Then
x = add
Else
for i=0 to ubound(p)
if p(i)=add then
response.write "<script language=javascript>alert('您已经将此商品加入了购物车,请不要重复!');javascript:history.go(-1);</script>"
response.End
end if
next
x = x & "," & add
End If
End Sub
'非相同过滤过程
Sub PutToShopBag2( x, y )
If Len(y) = 0 Then
y = x
Else
y = y & ","& x
End If
End Sub
ProdIds=Session("ProdIds")
ProdNums=Session("ProdNums")
if ProdIds<>"" then
prods = Split(ProdIds,",")
For i=0 To UBound(prods)
sql="select prod_info_name,prod_info_PriceS from prod_info where id="&prods(i)
Set rs=conn.Execute( sql )
prod_info_name = rs(0)
prod_info_PriceS = rs(1)
PutToShopBag prod_info_name, ProdNames
PutToShopBag2 prod_info_PriceS, ProdPrices
Next
end if
//购物车状态判断
If Len(ProdIds) = 0 Then
response.write "<script language=javascript>alert('对不起,您的购物车为空!');location.href=""index.asp"";</script>"
response.End
end if
'交易日期,格式:YYYYMMDD
yy=year(date)
mm=right("00"&month(date),2)
dd=right("00"&day(date),2)
'生成订单号所有所需元素,格式为:小时,分钟,秒
xiaoshi=right("00"&hour(time),2)
fenzhong=right("00"&minute(time),2)
miao=right("00"&second(time),2)
order_info_no =yy & mm & dd & xiaoshi & fenzhong & miao
order_info_RealName =my_request("order_info_RealName",0)
order_info_mobile =my_request("order_info_mobile",0)
order_info_tel =my_request("order_info_tel",0)
order_info_email =my_request("order_info_email",0)
order_info_address =my_request("order_info_address",0)
order_info_zip =my_request("order_info_zip",0)
order_info_pay =my_request("order_info_pay",0)
order_info_ProdCost =session("sum")
order_info_BuyNote =my_request("order_info_BuyNote",0)
order_info_BuyIP =Request.servervariables("REMOTE_ADDR")
order_info_pay =my_request("order_info_pay",0)
order_info_deliver =my_request("order_info_deliver",0)
order_info_up =my_request("order_info_up",1)
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select root_deliver_cost from root_deliver where root_deliver_name='"&order_info_deliver&"'"
rs.open sql,conn,1,1
order_info_DeliverCost=rs(0)
rs.close
set rs=nothing
order_info_AllCost =order_info_DeliverCost+order_info_ProdCost
if order_info_no="" or order_info_RealName="" or (order_info_mobile="" and order_info_tel="") or order_info_address="" or order_info_pay="" or order_info_deliver="" then
response.write "<script language='javascript'>"
response.write "alert('信息填写不完整!');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
else
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from Order_info"
rs.open sql,conn,1,3
rs.addnew
rs("order_info_no") =order_info_no
rs("order_info_RealName") =order_info_RealName
rs("order_info_mobile") =order_info_mobile
rs("order_info_tel") =order_info_tel
rs("order_info_email") =order_info_email
rs("order_info_address") =order_info_address
rs("order_info_zip") =order_info_zip
rs("order_info_pay") =order_info_pay
rs("order_info_deliver") =order_info_deliver
rs("order_info_DeliverCost")=order_info_DeliverCost
rs("order_info_ProdCost") =order_info_ProdCost
rs("order_info_AllCost") =order_info_AllCost
rs("order_info_BuyNote") =order_info_BuyNote
rs("order_info_BuyIP") =order_info_BuyIP
rs("order_info_BuyTime") =now()
rs("order_info_ProdIds") =ProdIds '订单所有商品id集合
rs("order_info_ProdNums") =ProdNums '订单所有商品数量集合
rs("order_info_ProdNames") =ProdNames '订单所有商品名称集合
rs("order_info_ProdPrices") =ProdPrices '订单所有商品单价集合
rs.update
rs.close
set rs=nothing
'删除购物车的商品id与数量的会话值
Session.Contents.Remove("ProdIds")
Session.Contents.Remove("ProdNums")
Session.Contents.Remove("ProdPrices")
'Session.Contents.Remove("ProdNames")
Session.Contents.Remove("sum")
Session.Contents.Remove("y")
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-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>订购成功</title>
</head>
<body>
<!--#include file=Top.asp-->
<!--#include file=Left.asp-->
<div id="MainNav">
<a href="index.asp">首页</a> » 订购成功
</div>
<h2>订购成功</h2>
<div class="MainDesc">
<table width=98% >
<tr><td><b>您的订单提交成功,感谢您订购我们商品!</b><hr class=dotline></td></tr>
<tr><td>您的订单号是: <font color=#FF3300><b><%=order_info_No%></b></font></td></tr>
<tr><td>您需要支付的金额是: <font color=#FF3300><b><%=order_info_AllCost%> 元</b></font><br></td></tr>
<%
dim order_info_remit
set rs=conn.execute("select top 1 order_info_remit from root_info")
order_info_remit=rs(0)
%>
<tr><td><b>如何支付</b><hr class=dotline></td></tr>
<tr><td><%=order_info_remit%></td></tr>
</table>
</div>
<!--#include file=End.asp-->
</body>
</html>
<%
if order_info_pay=1 then
sql="select root_AliPay_Email,root_AliPay_SafeCode,root_AliPay_ParterId from root_AliPay where id=1"
set rs=conn.execute (sql)
root_AliPay_Email =rs(0)
root_AliPay_SafeCode=rs(1)
root_AliPay_ParterId=rs(2)
rs.close
set rs=nothing
v_mid=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(root_AliPay_Email))),chr(13)&chr(10),"<br>")
key1 =replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(root_AliPay_SafeCode))),chr(13)&chr(10),"<br>")
PartnerID=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(root_AliPay_ParterId))),chr(13)&chr(10),"<br>")
call pay_AliPay()
Session.Contents.Remove("ProdNames")
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -