This commit is contained in:
differentreality 2013-07-12 13:27:11 +03:00
parent f39d72bf5d
commit e59dbb0208
2 changed files with 9 additions and 25 deletions

View file

@ -10,37 +10,21 @@ class Admin::StatsController < ApplicationController
people.public_name AS public_name,
people.email AS email")
@pre_registered = @conference.registrations.where("onsite = ?", false).count
@registered_attended = @conference.registrations.where("attended = ? AND onsite = ?", true, false).count
@registered_onsite = @conference.registrations.where("onsite LIKE ?", true).count
@registered_not_attended = @conference.registrations.where("attended LIKE ? AND onsite LIKE ?", false, false).count
@attendees = @conference.registrations.where("attended = ?", true).count
@registered = @conference.registrations.count
@registered_with_partner = @conference.registrations.where("attending_with_partner = ?", true).count
@attended_with_partner = @conference.registrations.where("attending_with_partner = ? AND attended = ?", true, true).count
@headers = %w[attended name email social_events with_partner need_access other_needs arrival departure onsite]
@events = @conference.events
@tracks = @conference.tracks
@event_states = @events.state_machine.states.map
@speakers = Person.joins(:events).where("events.conference_id = ? AND events.state LIKE ?", @conference.id, 'confirmed').uniq
@speaker_fields_person = %w[name email affiliation]
@speaker_fields_reg = %w[with_partner need_access other_needs diet arrival departure]
@supporter_levels = @conference.supporter_levels
@supporter_tickets = "t"
@professional_tickets = "t"
end
def reg_support (level)
def reg_support(level)
Registration.find_by_sql("select supporter_registrations.* FROM registrations, supporter_registrations, supporter_levels WHERE registrations.id = supporter_registrations.registration_id AND registrations.conference_id = #{@conference.id} AND supporter_registrations.supporter_level_id = #{level.id}")
end
def speaker_reg(speaker)
@ -54,5 +38,4 @@ class Admin::StatsController < ApplicationController
helper_method :speaker_reg
helper_method :speaker_diet
helper_method :reg_support
end