My site is going to be for booking sun loungers per day in hotels and parks. Normally the loungers cost a default price per day, but sometimes there is a peak rate (e.g. holiday season or weekends). So I have a table
special_prices
--------
start_date
end_date
price
And I have a search/calculator function which allows users to enter a start date and end date of when they'd like to hire a lounger and the calculator figures out a total price including the special rates.
Each lounger has it's own record, so I have all the special_price records associated with a particular lounger in an array, and I figured I should loop through each of these records and if the user inputted days fall between a special_price record's dates then I somehow need to count how many days need to have the increased amount added to it.
I'm having trouble figuring this out as I'm new to php and really just doing this for the learning experience. I've been fiddling with it for too long now though :(