function statistics_model() { global $events; global $events_data; global $prize_levels; $eventStats = array(); foreach (get_all_event_attendances() as $event) { $sliced = get_event_attendance_by_time_slice($event["eid"], DEFAULT_STATISTICS_TIME_SLICE); foreach ($sliced as $slice) { $time = $slice["timegroup"]; $zeroesAdded = 0; if (isset($prevTime)) { for ($i = $prevTime + DEFAULT_STATISTICS_TIME_SLICE; $i < $time; $i += DEFAULT_STATISTICS_TIME_SLICE) { if ($zeroesAdded >= 3) { break; } $sliced[] = array("timegroup" => $i, "att" => 0); $zeroesAdded++; } } $prevTime = $time; } unset($prevTime); usort($sliced, compare_timegroups); $eventStats[$event["eid"]] = array("name" => $events[$event["eid"]], "attendance" => $event["att"], "sliced" => $sliced, "majors" => get_major_counts($event["eid"])); } foreach ($events as $eventId => $eventName) { if (!isset($eventStats[$eventId])) { $eventStats[$eventId] = array("name" => $eventName, "attendance" => 0, "sliced" => array(), "majors" => array()); } } ksort($eventStats); $prizeEligibility = array(); foreach ($prize_levels as $minEvents => $prize) { $prizeEligibility[$prize] = count(get_eligible_users_with_min_events($minEvents)); } return array("view" => "statistics", "args" => array("eventStats" => $eventStats, "numRegisteredPassports" => count(get_eligible_users_with_min_events(0)), "numActionedPassports" => count(get_actioned_users()), "prizeEligibility" => $prizeEligibility, "totalScans" => count(get_all_scans()), "averageAttendance" => count(get_all_attendance_scans()) / count($events_data), "teams" => get_all_teams(), "majors" => get_major_counts(), "firstEvent" => get_first_event_counts(), "numEvents" => get_num_events_attended_counts(), "events" => $events)); }
<div class="emails_cont"> </div> </div> </div> </div> </form> </div> </div> <!-----end-accordian-1--------> <?php $client_id = $_SESSION['user_id']; $get_all_teams = get_all_teams($client_id); $count_teams = count($get_all_teams); if ($count_teams > 0) { //print_r($get_all_teams); die; foreach ($get_all_teams as $team_data) { $count_members = count(@$team_data['invites']); $team_id = $team_data['id']; ?> <div class="panel panel-default"> <div class="panel-heading"> <div class="row"> <div class="col-md-3 col-sm-3"> <p class="acrdion_text"><?php echo $team_data['name']; ?> <br><span class="scl_text2"><?php
function team_leaderboard_model() { return array("view" => "team_leaderboard", "args" => array("teams" => get_all_teams())); }