|
<%
if len(session("idCustomer")) > 0 then
dim mySQL, conntemp, rstemp, rsDisc
call openDB()
mySQL="SELECT idCustomer, customerType, name, lastName, idDiscount, DiscountText, activeDiscount, ProfileID FROM vs_Estore_CustomerDiscounts WHERE idCustomer=" & session("idCustomer") & " AND activeCustomer=-1 AND activeDiscount=-1"
'response.write("strEmail: " & strEmail & " Password: " & strPassword & " SQL: " & mySQL)
'response.flush
'response.write("UserProfile: " & Session("vProfileID"))
set rsDisc=conntemp.execute(mySQL)
if (err.number = 0) and (not rsDisc.eof) then
rsDisc.MoveFirst
if not isnull(rsDisc("idDiscount")) then 'User Profile has general discount available
%>
You have special discount available at the moment!
<%
while not rsDisc.EOF
if rsDisc("activeDiscount") = -1 then
response.write(rsDisc("DiscountText") & "
")
rsDisc.MoveNext
end if
wend
end if
end if
'mySQL="SELECT idCustomer, customerType, name, lastName, idDiscountPerQuantity, DiscountText, activeDiscount FROM vs_Estore_CustomerDiscountsPerQuantity WHERE idCustomer=" & Session("idCustomer") & " AND activeCustomer=-1" ' AND activeDiscount=-1"
mySQL="execute sp_EStore_CustomerProductDiscountLatest @idCustomer = 999"
'response.write mySQL
set rsDiscQty=conntemp.execute(mySQL)
if (err.number = 0) and (not rsDiscQty.eof) then
rsDiscQty.MoveFirst
blnHeaderWritten = false
while not rsDiscQty.EOF
if rsDiscQty("activeDiscount") = -1 then
if not blnHeaderWritten = true then
%>
You have special product offers available at the
moment!
<%
blnHeaderWritten = true
end if
response.write(rsDiscQty("DiscountText") & "
")
end if
rsDiscQty.MoveNext
wend
end if
else
'Cookie not readable - Do not display anything
end if
%>
|
|