<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "18, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 68, 69, 70, 71, 121, 164, 222" %> <% thispage="basket" %> <% aryCart2 = aryCart Function AddToExistingItem(V,Q,aryCart2) For comp = 0 to Application(HASHKEYNUMBERXYZ & "basketmaxcapacity") If aryCart2(comp,1) = V then aryCart2(comp,2) = aryCart2(comp,2) + Q duplicate = 1 end if next AddToExistingItem = aryCart2 End Function Function AddNewItemLine(V,Q,aryCart2) aryCart2(iCount,1) = V aryCart2(iCount,2) = Q iCount=iCount+1 AddNewItemLine = aryCart2 End Function Function TagRowForDeletion(R,aryCart2) For comp = 0 to Application(HASHKEYNUMBERXYZ & "basketmaxcapacity") If aryCart2(comp,1) = R then aryCart2(comp,1) = "" aryCart2(comp,2) = "" iCount = iCount - 1 end if next TagRowForDeletion = aryCart2 End Function Function SquashOutSpaces(aryCart2) For comp = 0 to (Application(HASHKEYNUMBERXYZ & "basketmaxcapacity")-1) If aryCart2(comp,2) = "" then aryCart2(comp,1) = aryCart2(comp + 1,1) aryCart2(comp,2) = aryCart2(comp + 1,2) aryCart2(comp + 1,1) = "" aryCart2(comp + 1,2) = "" end if next SquashOutSpaces = aryCart2 End Function duplicate = 0 R = Request.QueryString("R") V = Request.QueryString("V") Q = Request.Querystring("Q") strReturnURL = replace(replace(Request.QueryString("U"),"questionmark","?"),"ampersand","&") strSpeedMessage = Request.Querystring("strSpeedMessage") numLineCount = Request.Querystring("numLineCount") if Q="" then Q=1 Q=Q*1 product = Request.QueryString("product") If Request.Form("V")<>"" then V = Request.Form("V") end if If request.querystring("FF") = "yes" then V = "refresh" for tt = 1 to iCount aryCart2(tt-1,2) = (Request.querystring("T" & tt)) if Not IsNumeric(aryCart2(tt-1,2)) then aryCart2(tt-1,2) = "" iCount = iCount - 1 end if if aryCart2(tt-1,2) = "0" then aryCart2(tt-1,2) = "" iCount = iCount - 1 end if If IsNumeric(aryCart2(tt-1,2)) then aryCart2(tt-1,2) = Int(aryCart2(tt-1,2)) If aryCart2(tt-1,2) < 0 then aryCart2(tt-1,2) = "" iCount = iCount - 1 end if end if next end if If V <> "refresh" and V <> "remove" then If strReturnURL<>"" then strReturnURL = strReturnURL & "&strShowBackLink=n" For SpeedRows = 1 to numLineCount tempV = Request.querystring("V" & SpeedRows) tempQ = Request.querystring("Q" & SpeedRows)*1 If tempV<>"" then aryCart2 = AddToExistingItem(tempV,tempQ,aryCart2) If duplicate = 0 then aryCart2 = AddNewItemLine(tempV,tempQ,aryCart2) end if end if duplicate = 0 Next else aryCart2 = AddToExistingItem(V,Q,aryCart2) If duplicate = 0 then aryCart2 = AddNewItemLine(V,Q,aryCart2) end if end if end if If V = "remove" then aryCart2 = TagRowForDeletion(R,aryCart2) end if For y = 1 to Application(HASHKEYNUMBERXYZ & "basketmaxcapacity") aryCart2 = SquashOutSpaces(aryCart2) next %> <% If len(Request.Querystring("Empty")) > 0 then response.redirect("empty_bask.asp") If len(Request.Querystring("Checkout")) > 0 then response.redirect("shipto.asp") If len(Request.Querystring("Enquire")) > 0 then response.redirect("shipto.asp?m=enquiry") %> <% If quantitiesadjusted="yes" then strReturnURL="" If Application(HASHKEYNUMBERXYZ & "showbasket") = "n" AND strReturnURL<>"" then response.redirect(strReturnURL) Call ReadFromTemplate(templatelocation,aryPageTemplate,strBasketHTML,strCategoryListHTML) If IsNumeric(Application(HASHKEYNUMBERXYZ & "showbasket")) AND strReturnURL<>"" then strMetaRefresh="" If strSpeedMessage<>"" then strMetaRefresh="" aryPageTemplate(0) = Replace(aryPageTemplate(0),"","" & vbcrlf & strMetaRefresh) response.write(aryPageTemplate(0)) %>
<% WriteString("PageTitle_ShoppingBasket") %>
<% If strMetaRefresh<>"" then %>
<% WriteString("ContentText_ItemsAdded") %>

<% WriteString("ContentText_PleaseWait") %>
<% else If iCount = 0 then %> <% if V="speedorder" AND strSpeedMessage<>"" then %> <% end if %>
<% =strSpeedMessage %>
<% WriteString("ContentText_BasketEmpty") %>


<% else %>
<% If iCount>0 then for lp = 1 to iCount If DBType = "mysql" Then theQuery = "SELECT * FROM tbl_Versions INNER JOIN tbl_Products ON tbl_Versions.V_Product = tbl_Products.P_ID INNER JOIN tbl_ProductProdTypeLink ON tbl_Products.P_ID = tbl_ProductProdTypeLink.PPT_ProductID INNER JOIN tbl_Prodtype ON tbl_ProductProdTypeLink.PPT_ProdTypeID = tbl_Prodtype.PT_ID INNER JOIN tbl_TaxRates ON tbl_Versions.V_Tax = tbl_TaxRates.T_ID WHERE V_ID=" & aryCart2(lp-1,1) Else theQuery = "SELECT * FROM (tbl_Versions INNER JOIN ((tbl_Products INNER JOIN tbl_ProductProdTypeLink ON tbl_Products.P_ID = tbl_ProductProdTypeLink.PPT_ProductID) INNER JOIN tbl_Prodtype ON tbl_ProductProdTypeLink.PPT_ProdTypeID = tbl_Prodtype.PT_ID) ON tbl_Versions.V_Product = tbl_Products.P_ID) INNER JOIN tbl_TaxRates ON tbl_Versions.V_Tax = tbl_TaxRates.T_ID WHERE V_ID=" & aryCart2(lp-1,1) End If Call ExecuteSQL(theQuery,cursortype,rs_main) numItemQuantity = aryCart2(lp-1,2) If InStr(strAdjustedQuantity,"z" & rs_main("V_ID") & "z")>0 then bgcolor="mainpageversionhighlight" else bgcolor="mainpagetableline" end if %> <% If Application(HASHKEYNUMBERXYZ & "pricesinctax") = "y" then If Application(HASHKEYNUMBERXYZ & "showtaxdisplay") = "y" then %> <% Else %> <% End if Else %> <% End if %> <% rs_main.Close next end if %>
<% WriteString("ContentText_ExTax") %> (<% =Application(HASHKEYNUMBERXYZ & "currencyunit") %>)  <% WriteString("ContentText_IncTax") %> (<% =Application(HASHKEYNUMBERXYZ & "currencyunit") %>)  <% WriteString("ContentText_Qty") %>
<% response.write(rs_main("P_Name")) %>
&V=<% =rs_main("V_ID") %>&ph=basket"><% response.write(rs_main("V_Name")) %> <% response.write(rs_main("V_CodeNumber")) %><% =Pounds(numItemPriceExTax) %>  <% =Pounds(numItemPriceIncTax) %> <% =Pounds(numItemPriceIncTax) %> <% =Pounds(numItemPriceExTax) %>  <% =numTax*100 %>  &V=<% response.write("remove") %>" class="table"><% WriteString("FormButton_Remove") %>
<% if V="speedorder" AND strSpeedMessage<>"" then %> <% end if If quantitiesadjusted="yes" then %> <% end if numTotalBasketAmount = Round(numTotalPriceExTax + numTotalTaxAmount,2) If Application(HASHKEYNUMBERXYZ & "showtaxdisplay") = "y" OR Application(HASHKEYNUMBERXYZ & "pricesinctax")="n" then %> <% end if %>
<% =strSpeedMessage%>
<% WriteString("ContentText_OutOfStock") %>
 
<% WriteString("ContentText_OrderAmount")%> = <% =Application(HASHKEYNUMBERXYZ & "currencyunit") & " " & Pounds(numTotalPriceExTax) %>
<% WriteString("ContentText_TaxWhereApp")%> = <% =Application(HASHKEYNUMBERXYZ & "currencyunit") & " " & Pounds(numTotalTaxAmount) %>
<% WriteString("ContentText_Total")%> = <% =Application(HASHKEYNUMBERXYZ & "currencyunit") & " " & Pounds(numTotalBasketAmount) %>
" tabindex="3" name="Recalculate">" tabindex="4" name="Empty"><% if Application(HASHKEYNUMBERXYZ & "allowenquiries")="y" then %>" tabindex="2" name="Enquire"><% end if %> <% if (numTotalBasketAmount*1) < Application(HASHKEYNUMBERXYZ & "minorderval")*1 then %>" name="Checkout" onClick="alert('<% WriteString("Popup_OrderBelowMin")%> (<% =Application(HASHKEYNUMBERXYZ & "currencyunit") & Pounds(Application(HASHKEYNUMBERXYZ & "minorderval")) %>)')"><% else %>" name="Checkout"><% end if %>
<% end if %>
<% end if response.write(aryPageTemplate(1)) DataConn.Close set DataConn = nothing %>