RE: I could really use your help with it(making reservations to hotels etc)
| From: | Blake Binkley | Date: | Thu, 28 Dec 2000 10:13:20 +0000 |
| Subject: | RE: I could really use your help with it(making reservations to hotels etc) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32065@lists.php.net to get a copy of this message | ||
I think what you need to do is normalize the database
IE:
Table: Hotels
HotelID
HotelName
Table: Roomtypess
RoomTypeID
RoomType
Table: HotelRooms
HotelRoomID
HotelID
RoomID
RoomTypeID
Table: ReservedRooms
HotelRoomID
BeginReserveDate
EndReserveDate
now all you have to do is query for all ReservedRooms that fall into the
given dates and you will have a mask by which you can eliminate all roomIDs
for a given hotel that are booked between those dates leaving you with rooms
that are not booked during those dates for that hotel(hotels)
if you want an exacting query let me know.
Blake Binkley
-----Original Message-----
From: Siim Einfeldt aka Itpunk [mailto:siim_e@pshg.edu.ee]
Sent: Wednesday, December 27, 2000 1:25 PM
To: mysql@lists.mysql.com; php-general@lists.php.net
Subject: I could really use your help with it(making reservations to
hotels etc)
I need some help with making reservations to a hotel. I have the following
information in the database:
(1) hotel name
(2) room type
(3) number of places within some days
(4) the first date
(5) the last second date
The first and the last date represent the time for which the travel agency
has made their reservations to some hotel and the number represents the
number of rooms reserved for this period of time.
That was now the back-end stuff... Now, when customer comes to their
website, he/she chooses a hotel, room type and then he also types in the
dates, when he would like to stay there (I have dropdowns for that).
OK, that was the story. What I would like to know is, what would be the
best way to get to know if there will be free rooms. The travelling agency
has made different reservations in hotels usually for 1-2 days,eg:
Time period: 24.01.2001 - 26.01.2001 Number of rooms: 10
Time period 26.01.2001 - 27.01.2001 Number of rooms: 3
Lets imagine that now comes the customer, types in the time period
25.01.2001 - 27.01.2001, it covers one one period fully and another only
partly. damn...sorry, I even don`t know what I need from you exactly, I
guess I`d like to know
-->how could I check if there was free rooms for the full period of time
that the customer has entered AND -->how to write to the database, that
one room from that period and one room from half of the other period has
been reserved?
I don`t know, maybe it seems simple, but...by now my brain is dead. If
someone could help me, I would really appreciate it, maybe if someone has
done some site for some travelling agency himself, you could get in touch
and explain this thing a bit.
braindead...
Siim Einfeldt
itpunk@itpunk.com
--
---------------------------------------------------------------------
Please check "http://www.mysql.com/documentation/manual.php"
before
posting. To request this thread, e-mail mysql-thread60038@lists.mysql.com
To unsubscribe, send a message to:
<mysql-unsubscribe-mordron=aoj.net@lists.mysql.com>
If you have a broken mail client that cannot send a message to
the above address (Microsoft Outlook), you can use:
http://lists.mysql.com/php/unsubscribe.php