Ya that is possible,
Lest me through some ideas here:
- In database, you will need some:
- table for rooms (room no, its status,engaged/not)
- visitors...
- daily infos
- Now after user come, select an empty room and assign him/her. Put information in daily usage info.
- If goes out, assign the appropriate value.
- To get current in, just query for count of all active.
- To get users of the certain day, query for count of the day (you will have field for date in your datbase)