From 84ff92707569bf41466446d29366af767a5fcfda Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 26 Oct 2025 20:00:38 +0000 Subject: [PATCH] 3430403 --- index.php | 4 ++-- register.php | 47 ++++++++++++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/index.php b/index.php index 44f3034..9fce379 100644 --- a/index.php +++ b/index.php @@ -147,8 +147,8 @@ AppWizzy Logo -

Professional Vibe-Coding Webinar

-

Building Scalable Apps with AppWizzy

+

Building Scalable Apps with AppWizzy

+

Professional Vibe-Coding Webinar

WEDNESDAY, NOVEMBER 19 | 10AM EST | 7AM PST | 4PM CET

The fastest way to go from an idea to a working app you own, running on your server, with your database, using real frameworks.

diff --git a/register.php b/register.php index 4b62472..7baafc9 100644 --- a/register.php +++ b/register.php @@ -48,26 +48,35 @@ if (!$first_name || !$last_name || !$email) { } try { - // --- CHECK IF ALREADY REGISTERED --- - $stmt = db()->prepare("SELECT id FROM attendees WHERE webinar_id = ? AND email = ?"); + // --- CHECK IF ALREADY REGISTERED OR SOFT-DELETED -- - + $stmt = db()->prepare("SELECT id, deleted_at FROM attendees WHERE webinar_id = ? AND email = ?"); $stmt->execute([$webinar_id, $email]); - if ($stmt->fetch()) { - echo json_encode(['success' => false, 'error' => 'You are already registered for this webinar.']); - exit; - } + $existing_user = $stmt->fetch(PDO::FETCH_ASSOC); - // --- REGISTER USER --- - // Generate a password hash from the email as we don't have a password field - $password_hash = password_hash($email . time(), PASSWORD_DEFAULT); - $sql = "INSERT INTO attendees (webinar_id, first_name, last_name, email, company, how_did_you_hear, password, timezone) - VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; - $stmt = db()->prepare($sql); - $stmt->execute([$webinar_id, $first_name, $last_name, $email, $company, $how_did_you_hear, $password_hash, $timezone]); + if ($existing_user) { + if ($existing_user['deleted_at'] !== null) { + // --- USER IS SOFT-DELETED, SO REACTIVATE AND UPDATE --- + $sql = "UPDATE attendees SET first_name = ?, last_name = ?, company = ?, how_did_you_hear = ?, timezone = ?, deleted_at = NULL, consented = 1 WHERE id = ?"; + $stmt = db()->prepare($sql); + $stmt->execute([$first_name, $last_name, $company, $how_did_you_hear, $timezone, $existing_user['id']]); + } else { + // --- USER IS ACTIVE, SO REJECT --- + echo json_encode(['success' => false, 'error' => 'You are already registered for this webinar.']); + exit; + } + } else { + // --- REGISTER NEW USER --- + $password_hash = password_hash($email . time(), PASSWORD_DEFAULT); + $sql = "INSERT INTO attendees (webinar_id, first_name, last_name, email, company, how_did_you_hear, password, timezone) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; + $stmt = db()->prepare($sql); + $stmt->execute([$webinar_id, $first_name, $last_name, $email, $company, $how_did_you_hear, $password_hash, $timezone]); + } // --- SEND CONFIRMATION EMAIL --- $webinar_date_obj = new DateTime('2025-11-19 10:00:00', new DateTimeZone('America/New_York')); - $subject = "Confirmation: You're Registered for Professional Vibe-Coding Webinar"; - $body_html = "

You're in!

Thanks for registering for our webinar: Professional Vibe-Coding Webinar.

Building Scalable Apps with AppWizzy

It will take place on " . $webinar_date_obj->format('l, F j, Y \a\t g:i A T') . ".

You can now log in to your dashboard to see the details.

" + $subject = "Confirmation: You're Registered for Building Scalable Apps with AppWizzy"; + $body_html = "

You're in!

Thanks for registering for our webinar: Building Scalable Apps with AppWizzy.

Professional Vibe-Coding Webinar

It will take place on " . $webinar_date_obj->format('l, F j, Y \a\t g:i A T') . ".

You can now log in to your dashboard to see the details.

"; MailService::sendMail($email, $subject, $body_html); // --- PREPARE SUCCESS RESPONSE --- @@ -77,15 +86,15 @@ try { $webinar_date->add(new DateInterval('PT1H')); // Assume 1 hour duration $end_time_utc = $webinar_date->format('Ymd\THis\Z'); - $event_title = 'Professional Vibe-Coding Webinar at 4PM CET'; - $event_description = 'Building Scalable Apps with AppWizzy\n\nJoin us for this webinar at 4PM CET | 10AM EST | 7AM PST. The fastest way to go from an idea to a working app you own, running on your server, with your database, using real frameworks.'; + $event_title = 'Building Scalable Apps with AppWizzy at 4PM CET'; + $event_description = 'Professional Vibe-Coding Webinar\n\nJoin us for this webinar at 4PM CET | 10AM EST | 7AM PST. The fastest way to go from an idea to a working app you own, running on your server, with your database, using real frameworks.'; $google_link = 'https://www.google.com/calendar/render?action=TEMPLATE&text=' . urlencode($event_title) . '&dates=' . $start_time_utc . '/' . $end_time_utc . '&details=' . urlencode($event_description) . '&location=' . urlencode('Online') . '&ctz=UTC'; $ics_content = implode("\r\n", [ 'BEGIN:VCALENDAR', 'VERSION:2.0', - 'PRODID:-//Flatlogic//Professional Vibe-Coding Webinar//EN', + 'PRODID:-//Flatlogic//Building Scalable Apps with AppWizzy//EN', 'BEGIN:VEVENT', 'URL:' . 'http://' . $_SERVER['HTTP_HOST'], 'DTSTART:' . $start_time_utc, @@ -100,7 +109,7 @@ try { echo json_encode([ 'success' => true, - 'webinar_title' => 'Professional Vibe-Coding Webinar
Building Scalable Apps with AppWizzy', + 'webinar_title' => 'Building Scalable Apps with AppWizzy
Professional Vibe-Coding Webinar', 'google_link' => $google_link, 'outlook_link' => $outlook_link ]);