james6380
02-19-2008, 03:57 PM
Help having problems amending code to affect my hotel booking system I have 4 Prices for LOW, HIGH, Illuminations, BANK HOLIDAY
<%response.write(request.form("Day"))%>
<%response.write(request.form("Month"))%>
<%response.write(request.form("Year"))%>
<%
' -- GRAB CODE FEATURE --
strDay = Request.Form("Date")
strMonth = Request.Form("Month")
strYear = Request.Form("Year")
AdultNo = Request.Form("AdultNo")
ChildNo = Request.Form("ChildNo")
NoNights = Request.Form("NoNights")
' -- Grab Price Based on Month --
Select Case strDay strMonth strYear
' -- Low Season from Jan - April --
Case "1 January 2008 > 30 April 2008"
AdultPrice = 25.00
ChildPrice = 11.00
' -- High Season from May - Aug --
Case "1 May 2008 > 31 August 2008"
AdultPrice = 31.50
ChildPrice = 12.50
' -- Illuminations Season from September - November --
Case "1 September 2008 > 30 November 2008"
AdultPrice = 39.88
ChildPrice = 19.99
' -- Bank Holidays --
' ----------------------------------------
' -- (21 March 2008 - 24 March 2008) --
' -- (3 May 2008 - 5 May 2008) --
' -- (23 May 2008 - 26 May 2008) --
' -- (22 August 2008 - 25 August 2008) --
' ----------------------------------------
Case "21 March 2008 > 24 March 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "3 May 2008 > 5 May 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "23 May 2008 > 26 May 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "23 May 2008 > 26 May 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "22 August 2008 > 25 August 2008"
AdultPrice = 49.88
ChildPrice = 29.99
End Select
' -- Calculate Prices --
intAdultTotal = CDbl(AdultPrice) * (AdultNo)
intChildTotal = CDbl(ChildPrice) * (ChildNo)
intTotal = CDbl((intAdultTotal + intChildTotal) * NoNights)
' -- Illuminations Season from September - November --
Case "1 September 2008 > 30 November 2008"
AdultPrice = 39.88
ChildPrice = 19.99
Am I doing the wrong code as I keep getting
-----------------------------------------------
Microsoft VBScript compilation error '800a03ea'
Syntax error
/booking/step2.asp, line 54
Case "1 January 2008 > 30 April 2008"
^
-----------------------------------------------
<%response.write(request.form("Day"))%>
<%response.write(request.form("Month"))%>
<%response.write(request.form("Year"))%>
<%
' -- GRAB CODE FEATURE --
strDay = Request.Form("Date")
strMonth = Request.Form("Month")
strYear = Request.Form("Year")
AdultNo = Request.Form("AdultNo")
ChildNo = Request.Form("ChildNo")
NoNights = Request.Form("NoNights")
' -- Grab Price Based on Month --
Select Case strDay strMonth strYear
' -- Low Season from Jan - April --
Case "1 January 2008 > 30 April 2008"
AdultPrice = 25.00
ChildPrice = 11.00
' -- High Season from May - Aug --
Case "1 May 2008 > 31 August 2008"
AdultPrice = 31.50
ChildPrice = 12.50
' -- Illuminations Season from September - November --
Case "1 September 2008 > 30 November 2008"
AdultPrice = 39.88
ChildPrice = 19.99
' -- Bank Holidays --
' ----------------------------------------
' -- (21 March 2008 - 24 March 2008) --
' -- (3 May 2008 - 5 May 2008) --
' -- (23 May 2008 - 26 May 2008) --
' -- (22 August 2008 - 25 August 2008) --
' ----------------------------------------
Case "21 March 2008 > 24 March 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "3 May 2008 > 5 May 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "23 May 2008 > 26 May 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "23 May 2008 > 26 May 2008"
AdultPrice = 49.88
ChildPrice = 29.99
Case "22 August 2008 > 25 August 2008"
AdultPrice = 49.88
ChildPrice = 29.99
End Select
' -- Calculate Prices --
intAdultTotal = CDbl(AdultPrice) * (AdultNo)
intChildTotal = CDbl(ChildPrice) * (ChildNo)
intTotal = CDbl((intAdultTotal + intChildTotal) * NoNights)
' -- Illuminations Season from September - November --
Case "1 September 2008 > 30 November 2008"
AdultPrice = 39.88
ChildPrice = 19.99
Am I doing the wrong code as I keep getting
-----------------------------------------------
Microsoft VBScript compilation error '800a03ea'
Syntax error
/booking/step2.asp, line 54
Case "1 January 2008 > 30 April 2008"
^
-----------------------------------------------