Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-13-2006, 06:59 AM hotel season problem
Novice Talker

Posts: 6
Trades: 0
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.
z_cool is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-13-2006, 09:32 AM Re: hotel season problem
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
It all really depends on how you are handeling the clients stay range. If you are storing as an array (example: each day as an array item) then you could add a flag for each item. The flag could represent the season marking of that particular day. Using a flag of this type could also give you room to expand and also calculate free stays, discounts, or whatever else.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to hotel season problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21867 seconds with 12 queries