%@ Language=VBScript %>
<%
call ForceSSL()
id=Request.Cookies("id")
FirstTime = FormatTextHTML(request.Form("FirstTime"))
'qty = FormatTextHTML(request.Form("qty"))
DeleteList = Trim(Request.form("RemoveItem"))
qtyPassValue = FormatTextHTML(request.Form("qtyPassValue"))
qty = FormatTextHTML(request.Form("IngQuantity"))
IF subFlag ="" THEN
subFlag =0
END IF
'Get the Not Found list from Quick Shop
NoList = Trim(Request.form("NoList"))
IF NoList <> "" AND NoList <> "&" THEN
'split item into array
NotFoundList = split(NoList, "&", -1, 1)
'Not Found message
NFMsg="
The following item numbers could not be found in our catalog: "
NoList = right(NoList,(len(NoList)-1))
NoList = Left(NoList,(len(NoList)-1))
NoList = Replace(NoList,"&"," ")
NFMsg2="Check the item numbers and return to catalog quick shop or search for the items by title.
"
NFMsg= NFMsg & "
" & NoList & "
" & NFMsg2
END IF
DList = split(DeleteList, ",", -1, 1)
intDeleteTotal = UBound(DList)
QtyNUmber = split(qty, ",", -1, 1)
intQtyNBTotal = UBound(QtyNUmber)
QtyPV = split(qtyPassValue, ",", -1, 1)
intQtyPVTotal = UBound(QtyPV)
'response.write "DeleteList" & DeleteList & " "
'response.write "qty" &qty & " "
'response.write "qtyPassValue" &qtyPassValue & " "
'Remove the item that user checked.
IF FirstTime="false" THEN
'Add a cookies if user update the page
Automation=FormatTextHTML(request.Form("Automation"))
Response.Cookies("Automation")= Automation
'Delete Item from the shopping cart
IF DeleteList <> "" THEN
FOR n = 0 to intDeleteTotal
DListValue = split(DList(n), "&", -1, 1)
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "DELETE from ww_shoppingCartOrder where (usrsessid='"& id &"' AND lngFormatTypeID="& trim(DListValue(1)) &" AND strCatalogNumber='" & trim(DListValue(0)) & "')"
RS.Open strSQL, "DSN=dotcom",adOpenDynamic,3
set rs = nothing
Next
END IF
'Update Quantity after user change the number
FOR n = 0 to intQtyNBTotal
QTYValue = split(QtyPV(n), "&", -1, 1)
QTYNUValue = split(QtyNUmber(n), "&", -1, 1)
IF IsNumeric(QTYNUValue(0))THEN
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "UPDATE ww_shoppingCartOrder SET IngQuantity = "& trim(QTYNUValue(0)) &" where (usrsessid='"& id &"' AND lngFormatTypeID="& trim(QTYValue(1)) &" AND strCatalogNumber='" & trim(QTYValue(0)) & "')"
RS.Open strSQL, "DSN=dotcom",adOpenDynamic,3
set rs = nothing
END IF
Next
ELSE
Automation = Request.Cookies("Automation")
END IF
IF id <> "" THEN
'Load all the Order information
Set RS1 = Server.CreateObject("ADODB.Recordset")
strSQL = "Select * from ww_shoppingCartOrder where usrsessid='" & id &"' ORDER BY strTitle"
RS1.CursorLocation = 3
RS1.Open strSQL, "DSN=dotcom",adOpenDynamic,3
END IF
'------------------------------------Warning: Please don't rewrite the following code----------------------
Call ViewTotalOrder()
%>
Scholastic.com | Weston Woods Online Catalog: View Order
<%
doMenu
%>