Mr Chris Posted November 26, 2006 Share Posted November 26, 2006 Hi All,I'm trying to figure out the best way to design my content management system for a section that displays 'unavailable dates' for a specific property and would appreciate all advice.Now I have a DB of properties (lets say 800 properties)[b]properties_for_rent[/b]prop_id | Name | price----------------------------------------1 | Wrayfish | £2002 | Costa del la | £4003 | Terrace way | £6004 | Mid of Terrace | £800--> to 800| |I then want to say which dates throughout the year each property was unavaliable (because it's been booked already)Now the best way I thought of doing this was to create a [b]booked_dates[/b] table with the prop_id from the [b]properties_for_rent[/b] tabe as a FK to link the two tables together:[b]booked_dates[/b]booking_id| arrive | depart | prop_id* |----------------------------------------------------1 | 2006-12-28 | 2006-12-29| 1 |2 | 2006-12-28 | 2006-12-29| 2 |3 | 2007-01-25 | 2007-01-27| 1 |4 | 2006-07-28 | 2007-03-29| 4 |5 | 2006-11-28 | 2006-11-29| 1 |However - these are really the two questions I have:1) would this schema work well in the Content management system? I'd probably have thousands of booking date records in my CMS (although maybe I can delete all records in the booked dates table when a property is deleted?[b]And the main problem[/b]2) In the content management system for adding the booked dates how could I do this?For each property throughout the year there will be possibly hundreds of booked dates.Now I thought of adding a page like this for each property:http://www.slougheaz.org/directory/sp/select_dates.phpBut the bookings made may be for many more booked dates than this, so is there a better way of specifying the booked dates rather than having a large list of booked dates textboxes to fill in? Can anyone think of a better way of doing this?ThanksChris Quote Link to comment https://forums.phpfreaks.com/topic/28514-db-schema-advice/ Share on other sites More sharing options...
fenway Posted November 27, 2006 Share Posted November 27, 2006 Well, at some level, you have to store booked intervals for each property... and at some level, the number of records being created is not a problem (you can always display it in condensed version as a calendar). Quote Link to comment https://forums.phpfreaks.com/topic/28514-db-schema-advice/#findComment-130995 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.