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

📄 cart_ordersave.asp

📁 多多网店系统v3.01 完全免费可用版-功能简介: 支持多模板皮肤色切换[8套] 支持按商品特性[推荐商品/特价商品/新品分类]浏览 支持按商品类别浏览 支持单件商品用支付宝交易按钮直接支付订
💻 ASP
字号:
<%
dim dbpath
dbpath=""
%>
<!--#include file="Conn.asp"-->
<!--#include file="include/MyRequest.asp" -->
<!--#include file="include/nosql.asp" -->
<!--#include file="include/base64.asp"-->
<!--#include file="alipay/alipay_md5.asp"--> 
<!--#include file="alipay/alipay_payto.asp"--> 
<!--#include file="include/pay.asp"-->
<%
Sub PutToShopBag( x, y )
    If Len(y) = 0 Then
        y = x
    ElseIf InStr(y, x ) <= 0 Then
        y = y & ","& x
    End If
End Sub
   
ProdIds=Session("ProdIds")
ProdNums=Session("ProdNums")
   
if ProdIds<>"" then
    Products = Split(ProdIds,",")
    For i=0 To UBound(Products)
        sql="select Product_info_name,product_info_PriceS from product_info where id="&Products(i)
        Set rs=conn.Execute( sql )
        Product_info_name   = rs(0)
        product_info_PriceS = rs(1)
        PutToShopBag Product_info_name, ProdNames
        PutToShopBag product_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")
       
%>
<script LANGUAGE="JavaScript"> 
window.open ("Cart_OrderOk.asp?Order_info_no=<%=order_info_no%>&order_info_AllCost=<%=order_info_AllCost%>", "newwindow", "height=200, width=400, top=0, left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") 
</script>

<%  //付款方式处理
	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>")
        parterid=replace(strAnsi2Unicode(Base64decode(strUnicode2Ansi(root_AliPay_ParterId))),chr(13)&chr(10),"<br>")

        call pay_AliPay()  
        Session.Contents.Remove("ProdNames")
      
    else
        response.redirect "Cart_OrderOk.asp?order_info_no="&order_info_no&"&order_info_AllCost="&order_info_AllCost&""
        response.end        
    end if
end if                            
%>

⌨️ 快捷键说明

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