Wrox Programmer Forums
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 23rd, 2005, 06:41 PM
Registered User
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default What's the logic behind this Hotel Booking system?

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:


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:
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!

Similar Threads
Thread Thread Starter Forum Replies Last Post
booking system newbie07 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 July 19th, 2007 04:17 PM
Modifications in Appointment Booking System newbie07 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 July 18th, 2007 11:49 AM
Appointment Booking System newbie07 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 July 18th, 2007 08:32 AM
Access 97 and a booking system narelleallen Access 2 June 24th, 2004 10:04 AM
Celendar Booking System acdsky Classic ASP Basics 0 March 31st, 2004 02:42 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.