As a PHP/MySQL study project I have decided to write a resource scheduler. It could be used for anything from a rental car company to a beauty salon or doctor's office. (I figure it will take me a couple of years or more to write.) I decided to take a break from writing code today and work on some more planning so that my code would come together better in future sessions and this problem came to mind. If a resource is never available on the weekends or is only available between x and y hours, what's the best way to handle that? I was thinking of maybe using cross reference tables where a resource ID and a span of date-time would be blocked out. The same resource ID could appear in multiple rows of the same table with different blocks. (assuming there is a resource id "1" a row might be (1, friday 1800, monday 0900) and another row could be (1,monday 1200, monday 1300). Just writing this post helped me bring the above paragraph together enough to think it would work, but I'd still like to know, does this seem like a good method, or is there something better that comes to mind?
Interesting question, Ive never thought of anything like that before. But I found this, which seems to be useful. http://forums.whirlpool.net.au/forum-replies-archive.cfm/624905.html
Thanks for the link. It was an interesting read but It didn't seem to relate to what I am trying to do.