think tank forum

technology » problem

nestor's avatar
17 years ago
link
nestor
nestor
i have to make a php/mysql room booking system by next monday.

system is already in place - thus users aren't a problem.

can't use the gpl'd mrbs i. it's overkill ii. there is only one room iii. because our school already uses it (hard to explain, but basically i can't use it).

not sure where to start. blah.
lucas's avatar
17 years ago
r1, link
lucas
i ❤ demo
this post has been archived.
DaGr8Gatzby's avatar
17 years ago
link
DaGr8Gatzby
Drunk by Myself
Can you use PGSql? That's not GPL'd.
DaGr8Gatzby's avatar
17 years ago
link
DaGr8Gatzby
Drunk by Myself
http://www.postgresql.org/about/licence.html
nestor's avatar
17 years ago
link
nestor
nestor
k, that bit was badly explained. i can use gpl'd stuff, just not the MRBS (meeting room booking system).
nestor's avatar
17 years ago
link
nestor
nestor
here's how it is going to go down (in my mind):

users (already authenticated and logged in) can select from a date form. then they can select a time form, which doesn't show the blocks that have already been booked.

that sounds simple but i have no clue how to implement it.

any tips?
asemisldkfj's avatar
17 years ago
link
asemisldkfj
the law is no protection
this might not be the best way, but...

have a mysql column in the dates or times (or are you going to combine these into one?) table that you can toggle. I guess make it a boolean or something. or you could just make it a string and change it from "open" to "booked" or something like that. boolean is probably faster though, just thought the string way might explain it better.

anyway, if someone requests a date/time you can switch date/that time to "booked" or whatever boolean value you want to represent booked. when you offer up times/dates for people to choose from you don't even have to show the ones that have already been booked, just add WHERE status="booked" or something like that to the mysql query.

make sure you add something in an if statement that errors out if someone tries to book a date or time that's already been taken, just to be safe :).

anything that's not clear? or am I missing anything?
nestor's avatar
17 years ago
link
nestor
nestor
hmmmm.

let me explain further (as i **really** appreciate the advice).

the commerce student society has reserved access to one room for 5 hours/day on mondays-wednesdays and saturday-sunday. this access is intended for use by committees.

the way i'm seeing it is you call up a date, then a table is generated with all the available times. the issue is the database must contain all possible times, versus all possible times.
nestor's avatar
17 years ago
link
nestor
nestor
my problem is right now how can i generate a table for any given day?

i like the boolean booking though.
nestor's avatar
17 years ago
link
nestor
nestor
like the problem is i need to generate a table with all possible dates and times, which is pretty intense. e.g. if someone calls up Monday Nov 26 they need to see all the timeslots.
nestor's avatar
17 years ago
link
nestor
nestor
so i figured it out, thanks to the president of my school's computing students' society

i love student government sometimes
asemisldkfj's avatar
17 years ago
link
asemisldkfj
the law is no protection
awesome! what's the solution?
nestor's avatar
17 years ago
link
nestor
nestor
k, take the date of intended meeting.

then convert date into day -> based on the day echo a table corresponding to that day. click a link to book a time. if the time is booked the echo will say "booked" or something.

shazam!
asemisldkfj's avatar
17 years ago
link
asemisldkfj
the law is no protection
make sure no search engine robots decide to crawl your booking links :). or make them into form buttons instead of hyperlinks.
nestor's avatar
17 years ago
link
nestor
nestor
can't, its all authenticated.
asemisldkfj's avatar
17 years ago
link
asemisldkfj
the law is no protection
cool cool.

form buttons look nicer than hyperlinks, though :).
nestor's avatar
16 years ago
link
nestor
nestor
k, completely different problem. i'm not sure how to explain this so i'm not going to try.

"SELECT * FROM cs_tutor WHERE qlinkhost LIKE '$qlink' AND active IS NULL";

this brings up a user's tutoring listings so they can delete them.
however there are a few admins that want to be able to delete listings. is there any way for a few specific users to view all of them?

hmm... not sure if this is explained well at all but just writing this has got me thinking better.
nestor's avatar
16 years ago
link
nestor
nestor
I SOLVED IT!!!!

yay