This is for a sort of calendar where each day (1-31) should output. Later code works out if the room is booked or vacant.

The code above, outpits all the data but, unfortunately it ensures that for each $booking (in the loop), the day 1-31 outputs as well, so I currently show a calendar for the month with days like this, 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 etc, because there are three values in the @booking_data array.

I expect that a hash may help but I can't work out what way to build it ie what to put in it.

any advice on the code or a tip on maybe doing it totally differently, would be gratefully appreciated.

bazz

bazz

11-27-2009, 09:14 AM

finally, finally, I got it.

too a mixture of foreach, a hash a grep and an array. blimey that was a challenge.