Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Booking system error!
01-28-2007, 12:01 AM #1
- Join Date
- Jan 2007
- Thanked 0 Times in 0 Posts
Booking system error!
I'm in the process of writing an app to allow online bookings. It must also show when resources are booked in a calendar. This is done by changing the background colour to red for unavailable and green for available. Resources are booked per day, not per hour.
My code below works fine, EXCEPT when a booking period moves from one month into the next, in which case only dates booked in the beginning month show up. The db has no support for individual calendar dates including unbooked dates - it only carries the start and end date for each resource.
Other than this extremely frustrating issue its fine! PLEASE HELP????
Many thanks in advance!
set rsCal = cnndata.Execute("SELECT * FROM tblReservation")
While Not rsCal.EOF
If Not rsCal.EOF then HouseCO=rsCal("codate")
If Not rsCal.EOF then HouseCI = rsCal("cidate")
varDateNow = Cdate(varDateNow)
If Not rsCal.EOF AND varCurrentDate =< CDATE(CurrentDay & "/" & MyMonth & "/" & MyYear) then
If Not rsCal.EOF AND HouseCI = CDATE(CurrentDay & "/" & MyMonth & "/" & MyYear) then varBackground="red"
If HouseCO = CDATE(CurrentDay & "/" & MyMonth & "/" & MyYear) then varBackground="green"
If Not rsCal.EOF then rsCal.MoveNext
response.write "<td bgcolor='" & varBackground & "'"
01-29-2007, 01:46 PM #2
- Join Date
- Jun 2002
- London, UK
- Thanked 110 Times in 109 Posts
You use a number of variables in that code that are clearly populated somewhere else. My guess is that if you response.write() some of those variables, you'll find something in the output that doesn't make sense.