六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

購物車范例(購物車頁面 )

[摘要]<!--checkbag.asp--><!--shoppingcart page--><% response.expires = 0 response.expiresabsolute = Now() - 1 response.addHeader ...
<!--checkbag.asp-->

<!--shoppingcart page-->

<%  
    response.expires = 0
    response.expiresabsolute = Now() - 1
    response.addHeader "pragma","no-cache"
    response.addHeader "cache-control","private"
    Response.CacheControl = "no-cache"
%>

<!--#include file= "conn.asp"-->
<!--#include file= "char.inc"-->

<%
    'id_type=request("id_type")
    obj=request("obj")       '用做檢測是否是正常購買后的進入購物車取obj參數
    rid=session("id")         '取出會員id
    dim x,i
    dim obj_bag,bag_item,cart
           'obj_bag          ----購物車
           'bag_item        ----商品的信息數據集合
           'cart                ----一件商品的信息數據集合
    dim p_id,p_name,p_price,p_manu,p_type,p_size,p_color,p_num,p_total,sum
            'p_id               ----商品id號
            'p_name         ----商品名稱
            'p_price          ----價格
            'p_manu         ----制造商
        'p_type           ----商品式樣
            'p_size           ----尺寸
        'p_color          ----顏色
            'p_num           ----數量
            'p_total           ----小計
            'sum              ----合計金額

    dim id1

    if obj="1" then                                     obj為1說明由菜單欄點擊進入的
        if not isobject(Session("Bag")) then            如果Session("Bag")不是對象,說明購物車為空
            response.write "<script language=""javascript"">"
            response.write"alert(""購物車為空!"");" & chr(13)
            response.write "window.location='index.asp'"
            response.write "</script>"
            response.end
        else
            set obj_bag=Session("Bag")           若購物車不為空,將它賦給對象obj_bag
        end if
    else
        if isobject(Session("Bag")) then                  若不是菜單欄點擊進入的,則將購物車信息賦給對象obj_bag

            set obj_bag=Session("Bag")
        else                                                         若購物車為空,說明購物車內沒有商品,則返回首頁
            response.write "<script language=""javascript"">"
            response.write"alert(""T購物車為空!"");" & chr(13)
            response.write "window.location='index.asp'"
            response.write "</script>"
            response.end
        end if
      end if
            'response.write "<script>alert("""& isobject(obj_bag) &""")</script>"
      
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'判斷單擊的是購物車頁面下方的哪一個按鈕
''''''''''''''''''''''''''''''''''''''''

    select case request("action")          取得按鈕信息
   如果選擇刷新則重新計算商品的價值及總價
   將當前信息計算寫入購物車并顯示購物車
        case "refresh"        若為刷新   
            for each cart in obj_bag.items
                p_name=cart(0)     將購物車中的信息數據集合分別賦值給變量
                p_manu=cart(1)
                p_type=cart(2)
                p_size=cart(3)
                p_color=cart(4)
                p_price=cart(5)
                p_num=cart(6)
                p_id=cart(7)

                if request("checkBox_" & p_id)<>"" then         取得取消單選框的值,如果不為空,即打鉤
                    if obj_bag.Exists(p_name) then         如果商品已存在刪除該商品
                        obj_bag.remove(p_name)
                    end if
                else
                    p_num=trim(request("quantity"&p_name))     若沒有該操作,寫入購物車
                    if ((not IsNumeric(p_num)) or (p_num<="0") or (instr(1,p_num,".")<>0)) then
                        p_num=1
                    end if
                    bag_item=array(p_name,p_manu,p_type,p_size,p_color,p_price,p_num,p_id)
                    'response.write "p_num=" & p_num & "<br>"
                end if
            next
            set Session("Bag")=obj_bag            將obj_bag對象里的信息,寫入Session("Bag")

如果選擇去收銀臺則準備開始接收付款
將當前信息寫入購物車并轉向收銀程序
        case "check"                                               按鈕為購買的時候
            for each cart in obj_bag.items            循環cart將其所有信息都賦給變量
                p_name=cart(0)
                p_manu=cart(1)
                p_type=cart(2)
                p_size=cart(3)
                p_color=cart(4)
                p_price=cart(5)
                p_num=cart(6)
                p_id=cart(7)
            
                if request("checkBox_" & p_id)="" then  如果取消單選框為空,取id1的值
                    id1=p_id & "," & id1                 將他們有逗號形式連接
                end if
            next
            id1=left(id1,len(id1)-1)                                  
            shopping_id=request("id")
            set obj_bag=session("bag")
            set session("obj_bag")=obj_bag    
            call insertDB(id1)                                             調用函數
    end select
%>
'輸出HTML
。。。。。。。。。(略)




主站蜘蛛池模板: 日韩福利视频精品专区 | 羞羞影院男女午夜爽爽影视 | 三区在线视频 | 中文字幕伦伦精品 | 五月婷婷激情综合网 | 欧美亚洲综合在线观看 | 午夜在线播放免费高清观看 | 真实的国产乱xxxx | 亚洲视频精品在线 | 日本大片久久久高清免费看 | 天天操夜夜骑 | 三级国产在线 | 欧美香蕉视频在线观看 | 一区二区在线欧美日韩中文 | 亚洲第一页在线播放 | 亚洲国产成人久久午夜 | 深夜福利视频导航 | 伊人久久中文 | 色倩网站 | 一级片aaaa | 亚洲第一页国产 | 天天干夜啪 | 色综合合久久天天给综看 | 天天躁日日躁成人字幕aⅴ 天天躁日日躁 疯人影院 | 日韩亚洲一区中文字幕在线 | 日韩在线视 | 亚洲免费在线视频观看 | 日本捆绑调教hd在线观看 | 天天色天天色天天色 | 青娱乐在线免费观看视频 | 五月天天| 天天躁狠狠躁夜夜躁2021 | 深夜国产一区二区三区在线看 | 羞羞一区二区三区四区片 | 日本aⅴ在线不卡免费观看 日本aⅴ在线 | 天天透天天干 | 欧美午夜成年片在线观看 | 色妹子综合| 色欧美综合| 色天天干 | 手机av在线播放 |