diff --git a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/assets/css/hvac-certificates.css b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/assets/css/hvac-certificates.css index b450719a..475f7575 100644 --- a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/assets/css/hvac-certificates.css +++ b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/assets/css/hvac-certificates.css @@ -239,6 +239,25 @@ margin: 20px 0; } +/* Certificate link styling */ +.hvac-certificate-link { + color: #28a745; + text-decoration: none; + font-weight: 600; + transition: color 0.2s ease; +} + +.hvac-certificate-link:hover { + color: #218838; + text-decoration: underline; +} + +.hvac-certificate-link::after { + content: ' ↗'; + font-size: 0.8em; + vertical-align: super; +} + /* Stats cards */ .hvac-certificate-stats { display: grid; diff --git a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php index 78f86d44..08a462c0 100644 --- a/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php +++ b/wordpress-dev/wordpress/wp-content/plugins/hvac-community-events/templates/certificates/template-generate-certificates.php @@ -76,7 +76,10 @@ try { if (!empty($attendees) && class_exists('HVAC_Certificate_Manager')) { $certificate_manager = HVAC_Certificate_Manager::instance(); foreach ($attendees as $attendee) { - $attendee->has_certificate = $certificate_manager->certificate_exists($event_id, $attendee->attendee_id); + // Get the actual certificate data, not just boolean + $certificate = $certificate_manager->get_certificate_by_attendee($event_id, $attendee->attendee_id); + $attendee->has_certificate = !empty($certificate); + $attendee->certificate_data = $certificate; } } @@ -218,8 +221,35 @@ get_header(); - - Certificate Issued + certificate_data)) : ?> + $attendee->certificate_data->file_path, + 'event_name' => $selected_event_title, + 'attendee_name' => $attendee_name, + 'certificate_id' => $attendee->certificate_data->certificate_id + ); + $certificate_url = $security->generate_download_token( + $attendee->certificate_data->certificate_id, + $cert_data, + 3600 // 1 hour validity + ); + } + ?> + + + Certificate Issued + + + Certificate Issued + No Certificate