Hi, I have a table of events and a table of locations which are joined through a events_locations table which keeps track of what and where.
Each location may host many events, so my table contains two "interesting" columns: location-id and event-id.
In a fullcalendar view I am showing all the events.
I also have a link to the event list (based on the events table) as a "standard" list view.
In both of these I'd like to show the count of occurrencies of each scheduled event aside of the event name.
I.e. "event1 (45)" means that event1 is scheduled in 45 locations.
I think I should count how many event1 id are there in the events_locations table, then append this number to the event title.
What would the best approach be?
Thank you
P.s. a cool thing would be to dinamically update a status field to change colors through css if the event is not yet scheduled anywhere: event2 (0) - in gray
Each location may host many events, so my table contains two "interesting" columns: location-id and event-id.
In a fullcalendar view I am showing all the events.
I also have a link to the event list (based on the events table) as a "standard" list view.
In both of these I'd like to show the count of occurrencies of each scheduled event aside of the event name.
I.e. "event1 (45)" means that event1 is scheduled in 45 locations.
I think I should count how many event1 id are there in the events_locations table, then append this number to the event title.
What would the best approach be?
Thank you
P.s. a cool thing would be to dinamically update a status field to change colors through css if the event is not yet scheduled anywhere: event2 (0) - in gray