%@ LANGUAGE="VBSCRIPT"%> <% If Session( "varNotSet" ) = null or Session( "varNotSet" ) = "" then Dim sItemNums(0), nItemQtys(0) sItemNums(0) = "" nItemQtys(0) = 0 Session( "CartProdIDArray" ) = sItemNums Session( "CartProdQtyArray" ) = nItemQtys Session( "varNotSet" ) = 1 End If Function getCatName(id_tmp) strSQL1111 = "Select name from cat Where id = "&id_tmp Set rs1111 = Server.CreateObject( "ADODB.Recordset" ) rs1111.Open strSQL1111, Conn if not rs1111.eof then getCatName = rs1111("name") else getCatName = "-" end if End Function thetype = Request("thetype") seriesID = Request("seriesID") id = Request("id") catID = Request("catID") curpage = Request("curpage") sCartProdIDs = Session( "CartProdIDArray" ) nCartProdIDQtys = Session( "CartProdQtyArray" ) nNumCartProds = UBound( sCartProdIDs ) sMode = Request( "mode" ) Select case sMode Case "Proceed to Submit" sMode = "checkout" Case "Update Quantity" sMode = "recalc" Case "Continue Browsing" sMode = "continue" End Select If sMode = "add" then nThisProdIndex = 0 sProdID = Request("id") If nNumCartProds > 0 then For i = 1 to nNumCartProds If ( sCartProdIDs( i ) = sProdID ) then nThisProdIndex = i Exit For End if Next End if If nThisProdIndex = 0 then nThisProdIndex = nNumCartProds + 1 Redim Preserve sCartProdIDs( nThisProdIndex ) Redim Preserve nCartProdIDQtys( nThisProdIndex ) sCartProdIDs( nThisProdIndex ) = sProdID nCartProdIDQtys( nThisProdIndex ) = 1 Else nCartProdIDQtys( nThisProdIndex ) = nCartProdIDQtys( nThisProdIndex ) + 1 End if Session( "cartProdIDArray" ) = sCartProdIDs Session( "cartProdQtyArray" ) = nCartProdIDQtys nNumCartProds = UBound( sCartProdIDs ) End if If sMode = "remove" then n = Cint(request("n")) tempNumCartProds = UBound( sCartProdIDs ) - 1 Dim tempProdIDs() Redim tempProdIDs( tempNumCartProds ) Redim tempProdQtys( tempNumCartProds ) If UBound( sCartProdIDs ) = 1 then tempProdIDs(0) = "" tempProdQtys(0) = 0 Else count = 1 For i = 1 To nNumCartProds If Not i = n then tempProdIDs( count ) = sCartProdIDs( i ) tempProdQtys( count ) = nCartProdIDQtys( i ) count = count + 1 end if Next end if Session( "cartProdIDArray" ) = tempProdIDs Session( "cartProdQtyArray" ) = tempProdQtys nNumCartProds = UBound( tempProdIDs ) sCartProdIDs = Session( "CartProdIDArray" ) nCartProdIDQtys = Session( "CartProdQtyArray" ) End if If sMode = "recalc" or sMode = "checkout" or sMode = "continue" then For i = 1 to nNumCartProds nThisQty = int( Request.Form( "txtItemQty" & i ) ) nCartProdIDQtys( i ) = nThisQty Next Session( "cartProdIDArray" ) = sCartProdIDs Session( "cartProdQtyArray" ) = nCartProdIDQtys End if If sMode = "continue" then if thetype = "1" then Response.Redirect "products_show.asp?curpage="&curpage&"&catID="&catID else Response.Redirect "office_show.asp?curpage="&curpage&"&catID="&catID end if end if If sMode = "checkout" then Subtitle = "RFQ List" Else Subtitle = "View RFQ List" end if %>
|
|||