Hi,
I'm building a booking system for a client who rents out holiday cottages.
I'm stuck on this, rather central, point.
I retrieve a record set from the DB, getting the arrival date, departure date and the number of nights (I thought I'd keep it in there for simplicity). So the test data (essentially) returns these records:
2008-03-30 | 2008-04-05 | 6
2008-04-13 | 2008-04-20 | 7
2008-04-27 | 2008-05-01 | 4
What I'd like to get from this record set (which spans the current month, April) is either a range of unavailable dates (2008-03-30, 2008-03-31, 2008-04-01 etc) or perhaps an array like this
$dates = (30 = > booked, 31 => booked, 01 => booked, 02 => booked, 03 => booked, 04 => booked, 05 => free, 06 => free, etc );
with the day's date as the key.
Thanks for our advice guys.
Mei