protected function calculate_totals() { $all_attendees = Tribe__Tickets__Tickets::get_event_attendees($this->event_id); $total_attendees = count($all_attendees); $this->total_checked_in = Tribe__Tickets__Tickets::get_event_checkedin_attendees_count($this->event_id); $this->total_not_checked_in = $total_attendees - $this->total_checked_in; $this->total_deleted = Tribe__Tickets__Attendance::instance($this->event_id)->get_deleted_attendees_count(); }
<?php $this->attendees_table->prepare_items(); $event_id = $this->attendees_table->event->ID; $event = $this->attendees_table->event; $tickets = Tribe__Tickets__Tickets::get_event_tickets($event_id); $post_type_object = get_post_type_object($event->post_type); $checkedin = Tribe__Tickets__Tickets::get_event_checkedin_attendees_count($event_id); $total_sold = 0; $total_pending = 0; $total_completed = 0; foreach ($tickets as $ticket) { $total_sold += $ticket->qty_sold() + $ticket->qty_pending(); $total_pending += $ticket->qty_pending(); } $total_completed = $total_sold - $total_pending; ?> <div class="wrap tribe-attendees-page"> <h1><?php esc_html_e('Attendees', 'event-tickets'); ?> </h1> <div id="tribe-attendees-summary" class="welcome-panel"> <div class="welcome-panel-content"> <h3><?php echo '<a href="' . get_edit_post_link($event_id) . '" title="' . esc_attr__('Edit Event', 'event-tickets') . '">' . wp_kses(apply_filters('tribe_events_tickets_attendees_event_title', $event->post_title, $event->ID), array()) . '</a>'; ?> </h3> <p class="about-description"><?php echo '<a href="' . get_permalink($event_id) . '" title="' . esc_attr__('See Event Page', 'event-tickets') . '">' . get_permalink($event_id) . '</a>';