Forums

How to make a seat reservation system

kizmazhakan 19 Jul, 2012
Hi all.

I would like to do something as follows:

I'm a lecturer in a university and we have laboratory lessons the whole term but not all weeks of the term. Only some weeks.

There are some seats and desks the students may choose to sit in the laboratory.

At the beginning of the term, a student;
- will enter the laboratory website and log in,
- after that student will see the laboratory set up. There will be 10 desks and each desk will have 3 seats. And there are 3 sessions in one laboratory lesson (for example 09:00-10:00, 10:00-11:00, 11:00-12:00 ).
- first of all, student will choose the session that he/she wanted
- then, he/she will choose the desk
- then, he/she will choose the seat
- then, when these choises are submitted, the choises will be saved to the database. The same student will not be able to choose another seat. And another student will not be able to choose the chosen seat.
- when another student logs in the system to choose his/her seat, he/she will see the chosen and unchosen seats. And then, will choose a seat.


I think this system looks like a cinema ticket buying system.


Is it possible to make this via Chronoforms?
andypooz 19 Jul, 2012
You can definitely make such a system with Chronoforms, though you'll need to do quite a bit of custom coding as you've got some pretty sophisticated logic there!
Here are my ideas:

I assume you'll want some kinda of visual representation of the tables/seats and their availability- not strictly a chronoforms job, but can be done with javascript and css. If you had a visual representation then you wouldn't need to have separate dropdowns for desk and seat, you'd only need seat. If you wanted to be really fancy students could select the seat by clicking on the required seat on the map, or alternatively users could select their seat from a dropdown populated through a query:
SELECT id,name FROM #__labseats WHERE id NOT IN (SELECT seat_id FROM #__seatbookings WHERE datetime = $bookslot)

You'll need to know how to create a few custom php functions and fancy sql queries (and some javascript if you want to create a map of seats), but chronoforms is an excellent start. What you describe is complex but by no means the most ambitious application built using chronoforms.

Sounds like fun. Enjoy yourself!
Andy

PS. Have you checked extensions.joomla.org to see whether there is anything already built (You mention cinema system) that might suit your purposes with a few tweaks?
GreyHead 20 Jul, 2012
Hi kizmazhakan,

I agree with Andy that you should look and see if anything exists before developing your own.

I would make this a two-step form. The first would select the session. The second would use 30 radio buttons set out in a table to represent the benches and seats. You'd use a database query to find which seats are already taken for that session and disable those radio buttons.

You'd also need either a post-submission check or some Ajax code to avoid double reservations if two student happen to select the same seat at the same time.

Hope this helps.

Bob
kizmazhakan 21 Jul, 2012
Thanks guys. If i do that, i will share.

see ya
This topic is locked and no more replies can be posted.