Results 1 to 9 of 9

Thread: Multiple dates

  1. #1
    Join Date
    Feb 2005
    Posts
    81
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Multiple dates

    I want to build a simple hotel booking page

    Its only for 1 hotel so I just need something that will check to see if the date has been booked

    I am using a dmx extension for the calendar I am unsure how to make the page "book" from date 1 to date 2

    I assume the easiest what to do it is to get it to work out what days are between date 1 and date 2 and then loop through and insert it into the site as booked

    Any idea how I can do this in asp

    Thanks

  2. #2
    Join Date
    Jun 2004
    Posts
    224
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Not sure if this will be of any use to you http://www.hotscripts.com/Detailed/52900.html i found it whilst searching for a guest book script!
    Mark

    MightyGroup.net
    www.MightyGroup.net

  3. #3
    Join Date
    Jun 2005
    Posts
    1,081
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    I'm not sure how much of an experienced programmer you are, or how much you are quoting the Hotel to do this work. However, any booking system is never as easy as it first seems.

    Firstly you should bear in mind that this should eventually work in conjunction with any in-house reservation / booking system the Hotel uses.

    Now, to start with what you need to do is realize that this application will require a database and hence you should look at taking advantage of functionality exposed by the database.

    Using MS SQL as a database you could use a query with a 'BETWEEN' operator in the WHERE clause allowing you to check if something is between dates.

    I know I'm not providing much help here, but this sort of application is really much more complicated than simply trying to check dates. The number of rooms in the hotel as well as amenties per room make a big difference when putting together a hotel booking system.

  4. #4
    Join Date
    Sep 2005
    Location
    Halton, UK
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You could just have one record with a start date and an end date. Then when checking to see if a room is free you can check if any of the booked dates is between the start and end date of any reservation on that room.
    Hope that makes sense, otherwise I'll try to elaborate a bit more.

  5. #5
    Join Date
    Feb 2005
    Posts
    81
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    It is only for use for 1 Villa so it is either booked or not

    It is for the owner to display on his page to show when it is not available not for online booking as such

    I have the calendar setup already I need some way of inserting records into the db so it will insert something for all the dates from date1 to date2

    From 01/10/05 to 05/10/05

    I need the asp to insert into the database from the above info on the 01/10/05, 02/10/05, 03/10/05, 04/10/05, 05/10/05 rather than the owner doing this manually

    I thought about doing the difference between the 2 dates then adding 1 day then 2 days etc to the first day and inserting until the difference = 0

    Hope this makes it a little clearer lol

  6. #6
    Join Date
    Sep 2005
    Location
    Halton, UK
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Try making a stored proc such as:

    CREATE PROCEDURE InsertDates
    ( @StartDate DateTime
    , @EndDate DateTime
    )
    AS

    WHILE @StartDate < @EndDate
    BEGIN
    INSERT INTO [TableName] ([FieldName]) VALUES (@StartDate);
    SET @StartDate = DateAdd(Day, 1, @StartDate);
    END

  7. #7
    Join Date
    Feb 2004
    Posts
    4,901
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by RobvK
    Try making a stored proc such as
    Im pretty sure this is using a Microsoft Access database? I may be wrong
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  8. #8
    Join Date
    Sep 2005
    Location
    Halton, UK
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah right. Well then an equivalent ASP script shouldn't be too hard to do?

  9. #9
    Join Date
    May 2005
    Location
    Rugby, UK
    Posts
    69
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by s80wkr
    I thought about doing the difference between the 2 dates then adding 1 day then 2 days etc to the first day and inserting until the difference = 0
    Yes, that idea would work.

    Use DateDiff to find the number of days between the start and end dates, then use DateAdd within a loop to book each date of the holiday.

    There are references to DateDiff and DateAdd here, http://www.devguru.com/technologies/vbscript/index.asp

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. dates and uk / us format
    By askjim in forum ASP.NET
    Replies: 11
    Last Post: 29th November 2006, 08:38 AM
  2. Multiple Users Inserting Data
    By s80wkr in forum ASP (VBScript)
    Replies: 4
    Last Post: 24th February 2006, 03:24 PM
  3. Multiple Users in Outlook 2003
    By jaimalchohan in forum General Technical Support
    Replies: 5
    Last Post: 14th December 2005, 10:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •