|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi to evreyone!
I really need some help concerning my project at the university.I am doing a hotel reservation system with PHP and MySQL using Dreamweaver MX 2004. Can anyone advice me how to do the check availability callendar where a particular customer enters its arrival date, departure date,chooses a room type (Single,Double,Suite),number of adults,children and all these information are retrieved-linked to the MySQL database and return a particular result. Thanks in advance for spending your time reading my thread. Riginos |
|
#2
|
|||
|
|||
|
db schema
Hi, Riginos.
In simple mode I think will be: table rooms ( RoomID, Quantity, Type (set(Singel, Double, Suite) ) ); table orders ( OrderID, RoomID, Personal_Info( Adults, children ) - may use another table... Date_Arrive Date_Departure ); select (r.Quantity - count( OrderID)) as AvailableRooms from orders o, rooms r where r.Type='Single' and r.RoomID=o.RoomID and Date_Arrive < DayNow and DayNow+1 <= Date_Departure; DayNow - use from php you need. So, you will get the function for one of type for the selected day. P.S. I am not sure that this sql query will work, but you can use this in two queries. ![]() select Type, Quantity from rooms; select count( OrderID ) as UnAvailableRooms ... |
|
#3
|
|||
|
|||
|
you may use this function
checkdate (int month, int day, int year). it return you true if the date is valid and false when the date do not exist ( for example 31st feb 2005.) Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Hotel reservation system |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|