% Option Explicit %>
<%
Dim vntProductID
Dim vntQty
Dim vntBuffer
Dim vntNb
Dim vntStockItem
Dim I
Dim vntUpdate
Dim vntName
Dim vntStockCode
Dim vntPrice
Dim vntNewQty
Dim vntQtyID
Dim vntTotalOrder
Dim vntTotalVAT
Dim vntNewTotal
Dim vntSize
Dim vntSizeName
Dim vntTempBuffer
Dim vntMode
Dim vntLocation
Dim dblTotalLine
If Session("Connected") = "False" Then
%>
You must login before making an order!
<%
Response.End
End IF
If Trim(Session("CustomerID")) = "" Then
Session("CustomerID") = "0"
End If
If Session("CustomerID") = "0" Then
%>
You must provide your customer details before making an order!
<%
Else
vntUpdate = Request.Form ("btnUpdate")
vntMode = Request.QueryString ("Mode")
vntBuffer = Session("ProductOrder")
vntNb = Ubound(vntBuffer,2)
if vntMode = "Add" Then
vntTempBuffer = Session("TempBuffer")
Session("TempBuffer") = ""
on error resume next
vntProductID = vntTempBuffer(0,0)
if Trim(vntProductID) = "" Then
vntProductID = 0
end if
vntStockCode = vntTempBuffer(1,0)
vntPrice = vntTempBuffer(2,0)
If vntProductID <> 0 Then
If vntBuffer(0,0) <> "-1" Then
vntNB = vntNB + 1
Redim Preserve vntBuffer(5, vntNB)
End If
on error resume next
vntQty = clng(Request.Form ("txtQty"))
if err.number <> 0 then
vntQty = 1
end if
if vntQty = 0 Then
vntQty = 1
end if
vntStockItem = vntTempBuffer(3,0)
vntSize = Trim(Request.Form("txtSize"))
vntBuffer(0,vntNB) = vntStockCode
vntBuffer(1,vntNB) = vntStockItem
vntBuffer(2,vntNB) = vntQty
vntBuffer(3,vntNB) = "Order"
vntBuffer(4,vntNB) = vntPrice
vntBuffer(5,vntNB) = vntSize
Session("ProductOrder") = vntBuffer
vntLocation = Session("HTTPLocation")
Session("HTTPLocation") = Trim(vntLocation)
Response.Redirect Session("HTTPLocation")
Response.End
End If
End If
%>