%Option explicit%>
<%
'*******************************************************
' VP-ASP 6.50 Gift validation
' Jan 5, 2003
' March 26, 2004
'*******************************************************
dim sAction, Coupon
ShopPageHeader
if getconfig("xbreadcrumbs") = "Yes" then
response.write "
"
end if
response.write "" & getlang("langgiftcertificate") & "
"
Saction=Request("Action")
if sAction="" then
Saction=Request("Action.x")
end if
If saction="" then
AddForm
else
HandleAction
If Serror="" then
WriteInfoMessage
else
addForm
end if
end if
ShopPageTrailer
'
Sub AddForm
if sError<> "" then
Response.write errorfontstart & sError & errorfontend & "
"
Serror=""
end if
strGiftCertificate=Getsess("GiftCertificate")
Response.Write("")
end sub
Sub HandleAction
dim rc
'VP-ASP 6.50 - precautionary security fix
strgiftcertificate=cleanchars(request("strgiftcertificate"))
if strgiftcertificate="" then
Serror= getlang("LangGiftCertificate") & " " & getlang("Langcustrequired")
exit sub
end if
ShopvalidateGiftCertificate strgiftcertificate, Serror
'Debugwrite "return=" & serror
end sub
Sub WriteInfoMessage
dim toWrite
if request("howmuch") <> "" then
shopwriteheader getlang("langGiftRemain")
else
shopwriteheader getlang("LangGiftAccepted")
SetSess("Giftcertificate"),strgiftcertificate
toWrite = getlang("LangStatusAmount") & " = "
end if
dim amount
amount=getsess("giftamountmax")
If amount<>"" then
amount=shopformatcurrency(amount,getconfig("xdecimalpoint"))
shopwriteerror toWrite & amount
end if
end sub
%>