人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

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

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

更新時間:2022-10-16 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

<!--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參數(shù)
    rid=session("id")         '取出會員id
    dim x,i
    dim obj_bag,bag_item,cart
           'obj_bag          ----購物車
           'bag_item        ----商品的信息數(shù)據(jù)集合
           'cart                ----一件商品的信息數(shù)據(jù)集合
    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           ----數(shù)量
            '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                                                         若購物車為空,說明購物車內(nèi)沒有商品,則返回首頁
            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")          取得按鈕信息
   如果選擇刷新則重新計算商品的價值及總價
   將當(dāng)前信息計算寫入購物車并顯示購物車
        case "refresh"        若為刷新   
            for each cart in obj_bag.items
                p_name=cart(0)     將購物車中的信息數(shù)據(jù)集合分別賦值給變量
                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")

如果選擇去收銀臺則準(zhǔn)備開始接收付款
將當(dāng)前信息寫入購物車并轉(zhuǎn)向收銀程序
        case "check"                                               按鈕為購買的時候
            for each cart in obj_bag.items            循環(huán)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)                                             調(diào)用函數(shù)
    end select
%>
'輸出HTML
。。。。。。。。。(略)

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 桃园县| 德江县| 来凤县| 阳曲县| 高雄市| 太湖县| 麻江县| 邯郸市| 福鼎市| 大悟县| 涡阳县| 莲花县| 方城县| 孟州市| 额尔古纳市| 鄱阳县| 通辽市| 扶风县| 新邵县| 江都市| 林芝县| 池州市| 宜章县| 吐鲁番市| 通城县| 龙州县| 视频| 南通市| 上杭县| 临江市| 木兰县| 穆棱市| 治县。| 潢川县| 即墨市| 南投县| 耒阳市| 布尔津县| 石景山区| 基隆市| 涡阳县|