943,875 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 3718
  • PHP RSS
Apr 1st, 2009
0

How to implement check availability in hotel reservation system

Expand Post »
Hi ppl

I am developing website for my friend's very small resort, please see [url removed]

this resort have 8 rooms in total and all rooms are of same type so every room is equally priced.

I just need code or logic to check availability of given no. of rooms on given check in and check out dates.

when somebody makes a reservation, details that go in reservation table is:
booking_id
customer name
email
check-in date
check-out date
no. of rooms

Please help this is very critical as i will be integrating paypal also, so there should be no confusions...

thanks in advance
Last edited by Ezzaral; Apr 14th, 2010 at 2:29 pm. Reason: Snipped url.
Reputation Points: 10
Solved Threads: 0
Light Poster
jyotiu is offline Offline
33 posts
since Sep 2008
Apr 1st, 2009
0

Re: How to implement check availability in hotel reservation system

You can execute following query to determine whether new reservation for any room is confilicting with existing reservation for that room.
PHP Syntax (Toggle Plain Text)
  1. select * from reservtable where '{$fromdate}' <= check_out_date and '{$todate}'>= check_out_date and room='{$roomno}'
Reputation Points: 245
Solved Threads: 259
Nearly a Posting Virtuoso
urtrivedi is offline Offline
1,249 posts
since Dec 2008
May 24th, 2009
0

Re: How to implement check availability in hotel reservation system

if you find a solution please let me know
i am looking for the same thing
[removed email]
Last edited by Narue; May 24th, 2009 at 10:54 pm. Reason: snipped email
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sakisl is offline Offline
4 posts
since Dec 2007
May 24th, 2009
0

Re: How to implement check availability in hotel reservation system

Sorry to sound grouchy, but have you got anything yourself or do you expect some free work from scratch? If you post what you have, e.g. mysql queries/table structure/php code, I'd be happy to help.
Sponsor
Featured Poster
Reputation Points: 1048
Solved Threads: 948
Sarcastic Poster
ardav is offline Offline
6,694 posts
since Oct 2006
Apr 14th, 2010
-2
Re: How to implement check availability in hotel reservation system
Not Complate script, u must DB
Reputation Points: 8
Solved Threads: 0
Newbie Poster
gagah is offline Offline
1 posts
since Apr 2010
Apr 23rd, 2010
-3
Re: How to implement check availability in hotel reservation system
your all useless
Reputation Points: 7
Solved Threads: 0
Newbie Poster
PotatoJ is offline Offline
1 posts
since Apr 2010
Apr 24th, 2010
0
Re: How to implement check availability in hotel reservation system
If I understand it correctly, it is not a coding problem but you want to now how you can check if a room is free or not.

I had the same problem with a holiday home rental system years ago and solved it this way. Create a table with 365 records in it. This table has the following fields: id, date, number.
At the start of the year the field number will be 8 for every record.

As a customer selects a start and end date you first check to see if the start date is in the future and before the end date. If so, the selection is valid. Now you need to check if there is a room available.
Select from the table everything where date => startdate and date < enddate. Use a loop to see if any number field is 0 (meaning - nothing available). But if nothing is 0, subtract 1 from number and store it in the table again. A fragment of your table might look like
2010-05-01 8 (all rooms still free)
2010-05-02 7 (one room booked)
2010-05-03 0 (all rooms booked)
2010-05-04 4 (some rooms still free)
and so on.

It is even better to check for free rooms before the new customer can make a selection and display a calendar like selection method for instance with green and red colors that show what is free and what is not.
Last edited by colweb; Apr 24th, 2010 at 6:49 am.
Reputation Points: 34
Solved Threads: 52
Posting Whiz
colweb is offline Offline
316 posts
since Nov 2007
Apr 24th, 2010
0
Re: How to implement check availability in hotel reservation system
Please do not resurrect old threads. Have a look at forum rules.
Please read before posting - http://www.daniweb.com/forums/thread78223.html

Thread Closed.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in PHP Forum Timeline: A small Basic CMS sytem
Next Thread in PHP Forum Timeline: Turning php error off using htaccess, gives 500 error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC