calculation for accomodation
Posted: Tue Dec 05, 2006 5:31 am
My problem is calculation for accomodation.
I've got x periods of year
01/01 - 28/05
29/05 - 02/07
03/07 - 03/09
04/09 - 01/10
02/10 - 31/12
Each period of year has his price for accomodation
for example:
01/01 - 28/05 35€
29/05 - 02/07 45€
03/07 - 03/09 55€
04/09 - 01/10 45€
02/10 - 31/12 35€
Here comes problem
If user wants to spend his vacation on period from 28.06 until 07.07 here come two prices.
Calculation should be: 2 days at price 45€ and 7 day on price 55€
Total of this should be 445€.
periods are in database in timestamp format
if somebody can point me in right direction
regards ddragas
I've got x periods of year
01/01 - 28/05
29/05 - 02/07
03/07 - 03/09
04/09 - 01/10
02/10 - 31/12
Each period of year has his price for accomodation
for example:
01/01 - 28/05 35€
29/05 - 02/07 45€
03/07 - 03/09 55€
04/09 - 01/10 45€
02/10 - 31/12 35€
Here comes problem
If user wants to spend his vacation on period from 28.06 until 07.07 here come two prices.
Calculation should be: 2 days at price 45€ and 7 day on price 55€
Total of this should be 445€.
periods are in database in timestamp format
if somebody can point me in right direction
regards ddragas