prefix . 'hvac_certificates'; $table_exists = $wpdb->get_var("SHOW TABLES LIKE '$table_name'") === $table_name; if (!$table_exists) { throw new Exception("Certificate database tables are not properly set up."); } // Basic empty stats $certificate_stats = array( 'total' => 0, 'active' => 0, 'revoked' => 0, 'emailed' => 0 ); // Get user's events for filtering $events = get_posts(array( 'post_type' => 'tribe_events', 'posts_per_page' => -1, 'post_status' => 'publish', 'author' => $current_user_id )); // Get basic stats without using the certificate manager class $event_ids = array(); foreach ($events as $event) { $event_ids[] = $event->ID; } if (!empty($event_ids)) { $event_ids_string = implode(',', array_map('intval', $event_ids)); // Only run query if we have events if (!empty($event_ids_string)) { $stats_query = "SELECT COUNT(*) as total, SUM(CASE WHEN revoked = 0 THEN 1 ELSE 0 END) as active, SUM(CASE WHEN revoked = 1 THEN 1 ELSE 0 END) as revoked, SUM(CASE WHEN email_sent = 1 THEN 1 ELSE 0 END) as emailed FROM {$wpdb->prefix}hvac_certificates WHERE event_id IN ($event_ids_string)"; $result = $wpdb->get_row($stats_query); if ($result) { $certificate_stats = array( 'total' => intval($result->total), 'active' => intval($result->active), 'revoked' => intval($result->revoked), 'emailed' => intval($result->emailed) ); } } } // Empty certificates array to start with $certificates = array(); $total_certificates = 0; $total_pages = 0; $page = isset($_GET['certificate_page']) ? absint($_GET['certificate_page']) : 1; $per_page = 20; } catch (Exception $e) { echo '
Error: ' . esc_html($e->getMessage()) . '
'; } ?>

Certificate Reports

View and manage all certificates you've generated for event attendees.

Certificate Statistics

Total Certificates

Active Certificates

Revoked Certificates

Emailed Certificates

Certificate Filters

Certificate Listing

No certificates found matching your filters.

0 || (isset($_GET['filter_status']) && $_GET['filter_status'] !== 'active')) : ?>

Clear filters to see all your certificates.

Generate certificates for your event attendees on the Generate Certificates page.

certificate_number; $event_id = $certificate->event_id; $attendee_id = $certificate->attendee_id; $generated_date = date_i18n(get_option('date_format'), strtotime($certificate->date_generated)); $is_revoked = (bool) $certificate->revoked; $is_emailed = (bool) $certificate->email_sent; // Get event and attendee information $event_title = get_the_title($event_id); $attendee_name = get_post_meta($attendee_id, '_tribe_tickets_full_name', true); if (empty($attendee_name)) { $attendee_name = 'Attendee #' . $attendee_id; } // Status text and class $status_text = $is_revoked ? 'Revoked' : 'Active'; $status_class = $is_revoked ? 'hvac-status-revoked' : 'hvac-status-active'; ?>
Certificate # Event Attendee Date Generated Status Actions
Certificate has been revoked
×

Certificate Preview

admin_url('admin-ajax.php'), 'viewNonce' => wp_create_nonce('hvac_view_certificate'), 'emailNonce' => wp_create_nonce('hvac_email_certificate'), 'revokeNonce' => wp_create_nonce('hvac_revoke_certificate') )); // Footer get_footer(); ?>