|
I am trying to do a php script for a hotel.
The hotels have different prices for different seasons. The seasons vary from low season to high season.
The dates for the low season are as follows: 01 May 2006 to 14 Oct 2006.
for the high season are as follows: 15 Oct 2006 to 15 Apr 2007
In the form there will be the following fields:
Date of Arrival
Date of Departure
The accomodation type(e.g studio or apartment)
for both studio and apartment, there are 2 prices,i.e, one for low season and one for high season.
An example is if a client arrives in a low season period and departs in a high season period, the total of his stay will be as follows:
((Number of days he stayed in low season*price of accomodation)+(number of days he stayed in high season*price of accomodation))
If the clients comes in the same season and leaves in the same season, his total of stay will be calculated as below:
(Number of days stayed*price of accomodation)
It is to be noted that the accomodations and the seasons dates will be retrieved from the database.
The problem is that i can't find a solution to the problem of calculating the total price for the stay of the client wheh he arrives in a season and leaves in another season.
|