%@ LANGUAGE="VBSCRIPT" %>
<% PageStrings = "225, 226, 227, 228, 229, 230" %>
<%
'===============================================
' CactuShop ASP Shopping Cart
' ©1999-2004 Cactusoft Ltd. www.cactusoft.com
'===============================================
' All rights reserved.
' Use of this code is covered by the terms and
' conditions in the license agreement. No
' unauthorized duplication or distribution is
' permitted. Cactusoft's copyright notices must
' remain in the ASP sections of the code.
'===============================================
'-----------------------------------------------
'PROCESS SPEEDORDER REQUEST
'Number of Items which can be ordered at once is
'held in config table row ("SpeedRowCount"). This
'page cycles through order rows and formats a
'string to pass to basket.asp. Items which aren't
'available or can't be found are flagged and
'reported on the basket page. This page also
'handles items added to the basket from the main
'pages if using textboxes or dropdown.
'-----------------------------------------------
'-----------------------------------------------
'SET START VALUES
'-----------------------------------------------
strSpeedMessage = ""
strSpeedorder = request.form("strSpeedorder")
strAddButton = request.form("strAddButton")
strReturnURL = request.form("strReturnURL")
numLineCount = request.form("numLineCount")
'-----------------------------------------------
'LOOP THROUGH ITEMS AND BUILD STRING
'-----------------------------------------------
For numSpeedRows = 1 to numLineCount
strCode = Trim(Request.form("strCode" & numSpeedRows))
numQuant = Request.form("numQuant" & numSpeedRows)
If numQuant="" then numQuant=0
if (Not IsNumeric(numQuant)) AND strCode<>"" then
strSpeedMessage = strSpeedMessage & "
" & GetString("ContentText_Illegal1") & " '" & numQuant & "' " & GetString("ContentText_Illegal2") & " '" & strCode & "' " & GetString("ContentText_Illegal3") & "."
else
if strCode<>"" AND numQuant<>0 then
'-----------------------------------------------
'FORMAT QUERY AND RUN IT
'-----------------------------------------------
strQuery = "SELECT PT_Live, V_CodeNumber, V_Name" & CStr(numLanguageID) & ", V_ID, P_Name" & CStr(numLanguageID) & ", P_Live, V_Live, V_Quantity, V_QuantityWarnLevel FROM (((tblCactuShopTaxRates INNER JOIN tblCactuShopVersions ON tblCactuShopVersions.V_Tax = tblCactuShopTaxRates.T_ID) INNER JOIN tblCactuShopProducts ON tblCactuShopVersions.V_Product = tblCactuShopProducts.P_ID) INNER JOIN tblCactuShopProductProdTypeLink ON tblCactuShopProducts.P_ID = tblCactuShopProductProdTypeLink.PPT_ProductID) INNER JOIN tblCactuShopProdtype ON tblCactuShopProductProdTypeLink.PPT_ProdTypeID = tblCactuShopProdtype.PT_ID WHERE V_CodeNumber='"& SQLSafe(strCode) & "'"
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
If objRecordSet.recordcount<1 then
strSpeedMessage = strSpeedMessage & "
" & GetString("ContentText_Item") & " '" & strCode & "' " & GetString("ContentText_CouldNotBeFound")
else
if NOT((objRecordSet("V_Live")="y") AND (objRecordSet("P_Live")="y") AND (objRecordSet("PT_Live")="y")) then
strSpeedMessage = strSpeedMessage & "
" & GetString("ContentText_Item") & " '" & strCode & "' (" & objRecordSet("P_Name" & CStr(numLanguageID)) & "/" & objRecordSet("V_Name" & CStr(numLanguageID)) & ") " & GetString("ContentText_IsUnavailable")
else
strSpeedURL = strSpeedURL & "V" & numSpeedRows & "=" & objRecordSet("V_ID") & "&Q" & numSpeedRows & "=" & numQuant & "&"
end if
end if
objRecordSet.Close
end if
end if
Next
'-----------------------------------------------
'CLOSE DATA CONNECTIONS
'-----------------------------------------------
objDataConn.Close
set objDataConn = nothing
'-----------------------------------------------
'REDIRECT TO BASKET OR LAST PAGE
'Go to basket if some items were added or there
'were some product selection errors, otherwise
'go back to the page they came from.
'-----------------------------------------------
If len(strSpeedURL & strSpeedMessage)<>0 then
strSpeedURL = "basket.asp?numLineCount=" & numLineCount & "&" & strSpeedURL & "V_ID=speedorder&strSpeedMessage=" & Server.URLEncode(strSpeedMessage) & "&strReturnURL=" & strReturnURL
else
strSpeedURL = replace(replace(strReturnURL,":::","?"),"|||","&")
end if
response.redirect(strSpeedURL)
%>