CodeIgniter Forums
Events controller database - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Events controller database (/showthread.php?tid=8617)



Events controller database - El Forum - 05-24-2008

[eluser]Gewa[/eluser]
Hi All,
I am want now to make an eventing controller for Vienna, where I will store upcoming films which should be associated with cinemas, concerts, theaters and partys in Discos. Everything would be easyer , if there were no repeating events. Like there is for example "Indiana Jhones " today, tomorrow, ..... and in each day in different times in different Cinemas. The same with plays. It would be so annoying to add the same event 20times for exact time. So I need some help. If you could help me and advise the structure for repeating events, i would so appreciate your help. Please help if you can....Just give the way..
Thank you beforehand.


Events controller database - El Forum - 05-24-2008

[eluser]Pascal Kriete[/eluser]
Have unique events in an events table. And then use a foreign key to reference the event for each location/time.

Does that help?


Events controller database - El Forum - 05-24-2008

[eluser]Gewa[/eluser]
actually no. How you imagine adding repeating events. Lets say there is event each monday from xx-xx-xxxx--yy-yy-yyyy, or moday, thirthday, friday 10.00-12.00 . And so on. The way of adding them one time ...
this is the problem


Events controller database - El Forum - 05-24-2008

[eluser]Pascal Kriete[/eluser]
Oh, I gotcha now. You would have to create a script that, when given a series like that, computes the proper date for each event, and then adds it. I'll give it some thought later.


Events controller database - El Forum - 05-24-2008

[eluser]bradym[/eluser]
Create two tables:

event_data
- id
- name
- description
- location (if the location changes, this would go in event_session)

event_sessions
- event_id
- start_time
- end_time
- date

Create a form where the user enters the data for the event, as well as the start and end dates, start and end times. Write code to cycle through the date ranges and create an entry in entry_sessions for each day and time of the event.

This way if an event is canceled or rescheduled for some reason you can cancel or reschedule that specific event without having to worry about all of the other sessions of the event. You may want to add a canceled field to event_sessions to help with that.


Events controller database - El Forum - 05-25-2008

[eluser]Gewa[/eluser]
[quote author="bradym" date="1211698072"]Create two tables:

event_data
- id
- name
- description
- location (if the location changes, this would go in event_session)

event_sessions
- event_id
- start_time
- end_time
- date

Create a form where the user enters the data for the event, as well as the start and end dates, start and end times. Write code to cycle through the date ranges and create an entry in entry_sessions for each day and time of the event.

This way if an event is canceled or rescheduled for some reason you can cancel or reschedule that specific event without having to worry about all of the other sessions of the event. You may want to add a canceled field to event_sessions to help with that.[/quote]

I think better to add location in event_sessions table , as for example the same Indiana Johnes goes at 10.00-Cineplex, 13.00-CIneplex, 10.00-Another Cinema, 11.00-Another Cinema.

event_data
- id
- name
- description
- location
-status(active,disabled,postponed)
event_sessions
- event_id
- start_time
- end_time
- date
- location
-status
The problem of database is solved i think. The thing I couldn't understand and do properly is how to organize the ENTER EVENT section, to do it easyli.
Is it to make 2 step..
1. Step1.Enter Event add_event(id,name,description)
2.Add Event schedule add_event_date_loc ($event_id)

First function is very easy. Second one is problem . How is better to arrange the form...
There is for example each sunday in Disco N is going Party B, start at 10.00

or .
There is Play "XXXX" in Volksteater which will be on 12.06.2008 start on 16.00, 15.06.2008 start on 19.00 and 10 different variants.
So the form should be really good organized, and analizing function where all data will be posted the data also. I had no big experience with the dates ..

I am in blocked street.. Please help me go out Smile


Events controller database - El Forum - 05-25-2008

[eluser]Gewa[/eluser]
[quote author="inparo" date="1211667872"]Oh, I gotcha now. You would have to create a script that, when given a series like that, computes the proper date for each event, and then adds it. I'll give it some thought later.[/quote]

I would appreciate so much.
Thank you!


Events controller database - El Forum - 05-30-2008

[eluser]Gewa[/eluser]
no ideas?