Hi guys,
I have a strong problem that I just can't resolve becouse it's too difficult for me: hope you can help...
(the problem has more to do with programming than with "strict" ASP, but I write my pages in ASP so...)
I'd like to set a multi-Hotel Booking system, and to make things user-friendly I'd like the user to enter only start date, end date, # of people and # of rooms
I just can't understand how can I calculate the various combinations of people/rooms and what's the algorithm behind... to be clear, my "inspiration" is
www.venere.com, an italian site: here's a "live" example of what I'd like to achieve:
http://www.venere.com/hotel/index.php?htid=2302&lg=en
Just put dates from 01 november to 02 november and "play" with people and rooms: I found that:
- 1 people/1 room > 1 single room
- 2 people/1 room > 1 double room
- 3 people/1 room > 1 triple room
- 4 people/1 room > 1 quad room
- 2 people/2 rooms > 2 single rooms
- 3 people/2 rooms > 1 double + 1 single rooms
- 4 people/2 rooms > 2 double rooms
- 5 people/2 rooms > 1 double + 1 triple (but not 1 quad + 1 single: why? what's the logic behind? :-/)
- 6 people/2 rooms > various combinations (please check by ourself)
- 3 people/3 rooms > 3 single rooms
- 4 people/3 rooms > 2 single + 1 double rooms
- 5 people/3 rooms > 1 single + 2 double rooms (why not 1 triple + 2 singles?)
- 6 people/3 rooms > 3 double rooms
And so on...
I can imagine the DB structure for Rooms, maybe something like:
----------------------------------------
ID
Type (single, double, etc...)
Quantity (# of available rooms)
MaxPeople (people allowed for the room)
----------------------------------------
But... is there a "mathematical" logic in the scheme people/rooms above? Is there a function or a set of functions that describe these calculations? I'm sure there's one (the site is working great!) but I really can't find it...
Anyone would try, please? Thanks really so much, this is the most difficult thing I've ever found in my (ehm... short) career!