I'm administrating a simple website for a small society. We take turns to keep our locale clean and up until now, that has been handeled by writing our names on a paper calender.
Now we want to be able to do it online and I've come as far as to have made a working, bookable schedule using a MySQL database. To this I would like to add a simple function to give the person responsible for the cleaning schedule some administrative rights, such as beeing able to lock the schedule for further "bookings".
To accomplish this I was thinking of creating an "schedule_admin"-table, in which certain values could be used as flags to indicate if for example the schedule is locked or not.
The pseduo code would be something like this:
SELECT appropriate_col_name FROM schedule_admin
if flag == 'locked'
schedule is read/write
else
schedule is read only
Or if you want to lock/unlock the table it would be like:
Press button LOCK then
UPDATE schedule_admin VALUE('locked')
Press button UNLOCK then
UPDATE schedule_admin VALUE('unlocked')
Or is this way of doing it completely bananas?
Edit: I think I was abit unclear. What I really wanted was some kind of config table, from where the PHP script could extract data. (locked = 0 - allow booking, locked = 1 - don't allow booking).