#!/bin/bash

# Execute certificate helper script on the server

echo "=== Processing Attendees and Generating Certificates on Staging Server ==="
echo "Remote host: 146.190.76.204"
echo "Remote user: roodev"
echo "==============================="

# Copy PHP script to server and execute
echo "[1;33mCopying certificate helper script to server...[0m"
scp /Users/ben/dev/upskill-event-manager/wordpress-dev/bin/mark-attendees-checked-in.php roodev@146.190.76.204:~/public_html/

echo "[1;33mExecuting script on server...[0m"
ssh roodev@146.190.76.204 "cd ~/public_html/ && php mark-attendees-checked-in.php"

# Clean up
ssh roodev@146.190.76.204 "rm ~/public_html/mark-attendees-checked-in.php"

echo "[0;32mCertificate processing completed![0m"
echo "You can test the certificate system at: https://wordpress-974670-5399585.cloudwaysapps.com/certificate-reports/"
echo ""
echo "Features to test with this data:"
echo "1. Certificate filtering by event name"
echo "2. Certificate filtering by attendee name/email (new feature)"
echo "3. Certificate filtering by status (active/revoked)"
echo "4. Certificate email functionality"
echo "5. Certificate download functionality"