<% imagesPath="blue" TopBanner="#B8D6F5" Cbgcolor="#97CFF5" Cbgcolor2="#71BEF2" Cbgcolor3="#62AAE9" set conn=server.CreateObject ("adodb.connection") conn.CursorLocation =3 conn.Open Application("ConnectionStr") if SESSION("SHOPCARTCookID")="" then SESSION("SHOPCARTCookID")=Request.cookies("SHOPCARTCookID") if SESSION("SHOPCARTCookID")="" then SESSION("SHOPCARTCookID")=rnd()*1000000 Response.cookies("SHOPCARTCookID")=SESSION("SHOPCARTCookID") Response.Cookies("SHOPCARTCookID").Expires = DateAdd("d",30,now) END IF END IF action=request("action") select case action case "additem" GOODS_NO=CHECKSQL(REQUEST("GOODS_NO")) QTY=REQUEST("QTY") IF not isInt(qty) THEN QTY=1 IF QTY<=0 THEN QTY=1 if conn.Execute ("SELECT COOKID FROM ShopCart WHERE COOKID='"& SESSION("SHOPCARTCookID") &"' AND GOODS_NO='"& GOODS_NO &"'").EOF then SQLSTR=" INSERT INTO ShopCart (COOKID,GOODS_NO,QTY) VALUES (" & VBCRLF SQLSTR=SQLSTR & " '"& SESSION("SHOPCARTCookID") &"'," & VBCRLF SQLSTR=SQLSTR & " '"& GOODS_NO &"'," & VBCRLF SQLSTR=SQLSTR & " '"& QTY &"')" & VBCRLF else SQLSTR=" UPDATE ShopCart SET QTY=QTY + '"& QTY &"' WHERE COOKID='"& SESSION("SHOPCARTCookID") &"' AND GOODS_NO='"& GOODS_NO &"'" & VBCRLF end if CONN.Execute SQLSTR,,128 'SQLSTR="DELETE from SHOPCART WHERE QTY<=0 OR (GOODS_NO NOT IN (SELECT GOODS_NO FROM GOODS WHERE ISEFF IN ('Y','O')) and COOKID='"& SESSION("SHOPCARTCookID") &"')" SQLSTR="DELETE from SHOPCART WHERE QTY<=0" CONN.Execute SQLSTR,,128 '可以購買10元片子的檢查機制 sqlstr="select sum(qty) as qty10 from ShopCart " sqlstr=sqlstr & " inner join goods on ShopCart.goods_no=goods.goods_no WHERE ShopCart.COOKID='"& SESSION("SHOPCARTCookID") &"' and goods.pricea between 1 and 10" set rs10=conn.Execute (sqlstr) if rs10.eof then rs10.close set rs10=nothing CONN.Close SET CONN=NOTHING 'alertgoto "所選的商品已放入購物車",session("LinkStr"),"" 'Response.END Response.Redirect "ShopCart.asp" Response.End else if isnull(rs10(0)) then rs10.close set rs10=nothing CONN.Close SET CONN=NOTHING 'alertgoto "所選的商品已放入購物車",session("LinkStr"),"" 'Response.END Response.Redirect "ShopCart.asp" Response.End end if ' rs10(0) 已存在購物車內的數量 if clng(session("P10")) <%=application("companyName")%>
 
 
<% 'SQLSTR= "DELETE from SHOPCART WHERE QTY<=0 OR GOODS_NO NOT IN (SELECT GOODS_NO FROM GOODS WHERE ISEFF IN ('Y','O')) and COOKID='"& SESSION("SHOPCARTCookID") &"'" & vbcrlf SQLSTR="DELETE from SHOPCART WHERE QTY<=0" CONN.Execute SQLSTR,,128 SQLSTR="SELECT ShopCart.ID,ShopCart.GOODS_NO,GOODS.GOODS_NAME,GOODS.PRICE,GOODS.pricea AS PRICE2,SHOPCART.QTY,ISEFF FROM ShopCart " & vbcrlf SQLSTR=SQLSTR & "INNER JOIN GOODS ON ShopCart.GOODS_NO=GOODS.GOODS_NO " & vbcrlf SQLSTR=SQLSTR & " WHERE COOKID='"& SESSION("SHOPCARTCookID") &"' AND GOODS.ISEFF<>'n'" SET RS=CONN.Execute (SQLSTR) 'response.end if rs.eof then %> <% end if noMemCB=false DO WHILE NOT rs.EOF if clng(RS("PRICE2"))<=10 then noMemCB=true '非會如果買了10元光碟是不可結帳的 end if %> <% sumQty=sumQty + RS("QTY") sumPrice=sumPrice + RS("PRICE2") * RS("QTY") rs.movenext loop if rs.recordcount>0 then '折扣計算----------------------------------------------- if session("account")<>"" then '如果會員才算折扣 discPrice=0 sqlstr="select top 1 * from [info] where (itype between 'lv1' and 'lv5') and info1<=" & sumPrice & " order by info1 desc" set rs=conn.execute(sqlstr) if not rs.eof then discPrice=(sumPrice * rs("info2")/100 )-sumPrice %> <% end if end if '==================================================== if APPLICATION("portageLEVEL")>sumPrice then '運費 %> <% else%> <%end if end if%>
檢 視 購 物 車
刪除 產品名稱 產品編號 特價 數量 小計
您的購物車中沒有資料
" name="temp_id<%=rs("id")%>"> "> <%=RS("GOODS_Name")%> <%=RS("GOODS_NO")%> <%=FORMATNUMBER(RS("PRICE2"),0)%> " name="qty<%=rs("id")%>" STYLE="TEXT-ALIGN: right" ID="Text1"> <%=FORMATNUMBER(RS("PRICE2") * RS("QTY"),0)%>
會員折扣(金額超過<%=rs("info1") & ",折扣" & rs("info2") & "%"%>) <%=FORMATNUMBER(discPrice,0)%>
運費(金額超過<%=APPLICATION("portageLEVEL")%>免運費) <%=FORMATNUMBER(APPLICATION("portagePRICE"),0)%>
總 計 <%=formatnumber(sumQty,0)%> <%=formatnumber(discPrice+sumPrice+APPLICATION("portagePRICE"),0)%>
總 計 <%=formatnumber(sumQty,0)%> <%=formatnumber(discPrice+sumPrice,0)%>
<%if sumPrice>=500 then%>
<%if session("account")="" then%>
<%if noMemCB then%> <%else%> <%end if%>
確 定 結 帳 請 選 擇 您 的 身 份
1. 會員
2. 立即加入會員
3. 非會員
3. 非會員
<%else%> <%end if%>
<%else%>
「本站最低消費500元(不含運費)。 」
<%end if%>
Copyrightc© Two Sex Girls CD
建議瀏覽解析度 800X600

<% session("LinkStr")="/shopcart/shopcart.asp?" conn.Close set conn=nothing %>