Jump to content

How would I go about structuring the following scheduler script?


ghurty

Recommended Posts

How would I go about this project of mine:

 

Imagine if you had a building that had a 20 conference rooms. And you had users who would like to schedule time in the conference rooms. The maximum length of time allowed in a conference room is 5 minutes.

So the user would browse to see when the room is available. They have 35 people that they want to put in the conference room. So they just an available time (3 PM). 20 of their people are in there between 3 to 3:05 when they are using all the available conference rooms. Then they have 15 people in between 3:05 and 3:10. This allows on 5 rooms available for a different user to use it with their people.

 

Each individual user does not see who else is using it, rather just if it available or not. When the first user selected 3 PM. The system should give him an estimate that he will be done by 3:10. If a different user with 35 tried making an appointment for 3:05, it would realize that there are 5 slots available for 3:05, 20 for 3:10 and 20 for 3:15. So it would user 5 at 3:05, 20 at 3:10 and 10 at 3:15. So it would give an estimate of done by 3:20.

 

Each user would not see the exact amount of slots available, just that there is availability at that time. As long as there is one slot available at that time, it would show availability. Just the length of time until completion would be longer.

 

The user just chooses a starting time, and the system will book all the slots necessary.

 

 

 

Any ideas of what would the best way to structure the script and the table.

 

 

Thanks

Link to comment
Share on other sites

I don't understand what you are actually trying to accomplish but I'm guessing that if I would book a conference room I would want all of our staff to be in the same room not spread across many rooms. I also would want to conference for a little longer then 5 minutes usually just discussing the agenda already takes about 20 minutes or so.

 

I would opt for a table structure like:

 

room (id, name, capacity)

booking (id, room_id, alias, cost, start, estimated_end, is_paid)

 

Then to tell which conference rooms are available at $time

 

SELECT * FROM room JOIN booking ON room.id = booking.room_id WHERE $time NOT BETWEEN start AND estimated_end+$treshold AND room.capacity >= $capacity

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.