⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Meeting Room Booking



likhon3k
  • profile picture
  • Member

Posted 20 September 2013 - 20:39 PM

Hello All,

 

I searched about it in this forum. I have a query regarding meeting room booking system. I wanted to buildup a meeting room booking system by using CRUD.

 

I want to do this by this way:

 

1. Table Name: Room_Booking

 

Meeting_Title, Room_Name, Date, start_time, end_time  >> this is the table field.

 

If some one booked a room for this table like:

 

General Meetings, 302, 22/09/2013, 10:00, 12:00 as per "Room_Booking" Table field.

 

If another one wanted to book the room as same time and date with same room number then it will show warrning like "room is already booked. Please choose another slot...".

 

If that person will add the time for 13:00 to 14:00 then it will be booked.

 

 

what can to do: for this i think we need to check date with time is already inserted or not, if inserted then warrning will be shown. otherwise room will be booked, i think like this way.

 

any one can give me a solution. I tried to do this but failed to checked the date and time to 2nd time data insert...

 


davidoster
  • profile picture
  • Member

Posted 20 September 2013 - 21:22 PM

1. create a custom database model that extends CI_Model, to make it easier

2. use the callback_before_insert and maybe callback_before_update

3. within your callback run a function from your custom database model that check if there is an available slot for the specified time and

4. allow or not the addition of a new booking


likhon3k
  • profile picture
  • Member

Posted 21 September 2013 - 06:54 AM

1. create a custom database model that extends CI_Model, to make it easier

2. use the callback_before_insert and maybe callback_before_update

3. within your callback run a function from your custom database model that check if there is an available slot for the specified time and

4. allow or not the addition of a new booking

can give me an example? It is easy to draw its flow chart but I am facing when I wanted to implement it.


davidoster
  • profile picture
  • Member

Posted 21 September 2013 - 22:06 PM

1. http://ellislab.com/codeigniter/user-guide/general/models.html

2. http://www.grocerycrud.com/documentation/options_functions/callback_before_insert

3. /topic/1578-filter-relation-using-third-table/#entry6865

4. at your callback_before_insert return null if you shouldn't allow a new insert otherwise $post_array