This commit is contained in:
Flatlogic Bot 2025-10-17 09:40:58 +00:00
parent b7c23d9356
commit 9a7532b7f7
7 changed files with 206 additions and 96 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

View File

@ -0,0 +1,4 @@
ALTER TABLE `attendees`
CHANGE `name` `first_name` VARCHAR(255),
ADD `last_name` VARCHAR(255) NULL AFTER `first_name`,
ADD `how_did_you_hear` VARCHAR(255) NULL;

8
describe_table.php Normal file
View File

@ -0,0 +1,8 @@
<?php
require_once 'db/config.php';
try {
$stmt = db()->query('DESCRIBE attendees');
print_r($stmt->fetchAll(PDO::FETCH_ASSOC));
} catch (PDOException $e) {
echo 'Error: ' . $e->getMessage();
}

265
index.php
View File

@ -1,114 +1,203 @@
<?php
require_once 'db/config.php';
$webinar = null;
try {
// Fetch the first upcoming webinar
$stmt = db()->prepare("SELECT * FROM webinars WHERE scheduled_at > NOW() ORDER BY scheduled_at ASC LIMIT 1");
$stmt->execute();
$webinar = $stmt->fetch();
} catch (PDOException $e) {
// Silently fail for now
}
$webinar_id = $webinar ? $webinar['id'] : 1; // Fallback to 1 if no webinar is found
$webinar_title = $webinar ? $webinar['title'] : 'Professional Vibe-Coding Webinar';
$webinar_date_str = $webinar ? (new DateTime($webinar['scheduled_at']))->format('l, F j \\ • \\ At g.i A T') : 'Monday, November 3 • At 6.00 PM PST';
?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= htmlspecialchars($webinar_title) ?></title> <title>Webinar Registration</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style> <style>
body { body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: #1a202c; background-color: #f8f9fa;
color: #e2e8f0; }
margin: 0; .webinar-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh; min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.webinar-card {
width: 100%;
max-width: 1200px;
box-shadow: 0 10px 40px rgba(0,0,0,0.1);
border-radius: 20px;
overflow: hidden;
background: #fff;
}
.left-column {
padding: 60px;
}
.right-column {
background-color: #0d244f;
color: #fff;
padding: 60px;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0,50 Q25,25 50,50 T100,50" stroke="%231a3a7a" fill="none" stroke-width="1"/></svg>');
}
.brand-logo {
font-weight: bold;
font-size: 1.5rem;
margin-bottom: 40px;
}
.exclusive-tag {
color: #0d6efd;
font-weight: bold;
letter-spacing: 1px;
font-size: 0.8rem;
}
.webinar-title {
font-size: 2.8rem;
font-weight: bold;
margin-top: 10px;
}
.webinar-time {
color: #6c757d;
margin-top: 20px;
font-weight: 500;
}
.webinar-description {
margin-top: 20px;
font-size: 1.1rem;
color: #495057;
}
.speakers-section {
margin-top: 40px;
}
.speakers-section h3 {
font-weight: bold;
margin-bottom: 20px;
}
.speaker-card {
text-align: center; text-align: center;
} }
.container { .speaker-card img {
max-width: 800px; width: 80px;
padding: 2rem; height: 80px;
border-radius: 50%;
object-fit: cover;
margin-bottom: 10px;
} }
.schedule-block { .form-control {
background-color: #2d3748; background-color: #fff;
border-radius: 0.5rem; border: 1px solid #ced4da;
padding: 2rem; border-radius: 8px;
border: 1px solid #4a5568; padding: 12px 15px;
} }
h2 { .btn-register {
color: #f6e05e; background-color: #0d6efd;
font-size: 1.5rem; color: #fff;
margin-bottom: 1rem; border: none;
text-transform: uppercase; border-radius: 8px;
padding: 12px;
width: 100%;
font-weight: bold;
} }
ul { .what-you-learn {
margin-top: 40px;
}
.what-you-learn h4 {
font-weight: bold;
}
.what-you-learn ul {
list-style: none; list-style: none;
padding: 0; padding-left: 0;
margin: 0 0 1.5rem 0;
text-align: left;
display: inline-block;
} }
li { .what-you-learn li::before {
margin-bottom: 0.5rem; content: "-";
font-size: 1.125rem; margin-right: 10px;
}
.date-time {
font-size: 1.25rem;
font-weight: bold;
margin-bottom: 1.5rem;
}
.register-button {
display: inline-block;
background-color: #f6e05e;
color: #1a202c;
padding: 0.75rem 1.5rem;
border-radius: 0.375rem;
text-decoration: none;
font-weight: bold;
font-size: 1.125rem;
transition: background-color 0.2s;
margin-bottom: 1.5rem;
}
.register-button:hover {
background-color: #f6d32d;
}
.byline {
font-size: 1rem;
color: #a0aec0;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="webinar-container">
<h1 style="font-size: 2.5rem; font-weight: bold; color: #f6e05e; margin-bottom: 0.5rem;">Professional Vibe-Coding Webinar by Flatlogic</h1> <div class="webinar-card">
<p style="font-size: 1.25rem; color: #a0aec0; margin-bottom: 2rem;">Professional VibeCoding: the fastest way to go from an idea to a working app you own, running on your server, with your database, using real frameworks.</p> <div class="row g-0">
<div class="schedule-block"> <div class="col-lg-7">
<h2>Schedule</h2> <div class="left-column">
<img src="assets/pasted-20251017-093140-48a8b5ba.png" alt="Flatlogic" style="width: 280px; margin-bottom: 40px; display: block;">
<div class="exclusive-tag">EXCLUSIVE WEBINAR</div>
<h1 class="webinar-title">Professional Vibe-coding by Flatlogic</h1>
<div class="webinar-time">TUESDAY, DECEMBER 29 | 1PM EST | 10AM PST | 7PM CET</div>
<p class="webinar-description">The fastest way to go from an idea to a working app you own, running on your server, with your database, using real frameworks.</p>
<div class="speakers-section">
<h3>Speakers</h3>
<div class="row">
<div class="col-md-4">
<div class="speaker-card">
<img src="https://i.pravatar.cc/80?img=4" alt="Philip Daineka">
<h5>Philip Daineka</h5>
<p class="text-muted">CEO, Flatlogic</p>
</div>
</div>
<div class="col-md-4">
<div class="speaker-card">
<img src="https://i.pravatar.cc/80?img=3" alt="Alexandr Rubanau">
<h5>Alexandr Rubanau</h5>
<p class="text-muted">Lead Engineer</p>
</div>
</div>
<div class="col-md-4">
<div class="speaker-card">
<img src="https://i.pravatar.cc/80?img=5" alt="Alexey Vertel">
<h5>Alexey Vertel</h5>
<p class="text-muted">Lead Engineer</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-5">
<div class="right-column">
<h2>Register now</h2>
<p>Don't miss this chance to learn and get your questions answered</p>
<form action="register.php" method="POST">
<div class="row mb-3">
<div class="col">
<input type="text" class="form-control" name="first_name" placeholder="First name" required>
</div>
<div class="col">
<input type="text" class="form-control" name="last_name" placeholder="Last name" required>
</div>
</div>
<div class="mb-3">
<input type="email" class="form-control" name="email" placeholder="email@website.com" required>
</div>
<div class="mb-3">
<input type="text" class="form-control" name="company" placeholder="Company">
</div>
<div class="mb-3">
<label class="form-label">How did you hear about this webinar?</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_did_you_hear" id="social" value="Social Media">
<label class="form-check-label" for="social">Social Media</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_did_you_hear" id="word" value="Word of mouth">
<label class="form-check-label" for="word">Word of mouth</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_did_you_hear" id="ad" value="Advertisement">
<label class="form-check-label" for="ad">Advertisement</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="how_did_you_hear" id="other" value="Other">
<label class="form-check-label" for="other">Other</label>
</div>
</div>
<button type="submit" class="btn-register">Register</button>
</form>
<div class="what-you-learn">
<h4>SCHEDULE</h4>
<ul> <ul>
<li> Intro ~10 min</li> <li>Intro ~10 min</li>
<li> Creating Apps ~40-50 min</li> <li>Creating Apps ~40-50 min</li>
<li> Q&A</li> <li>Q&A</li>
</ul> </ul>
<div class="date-time">
<?= htmlspecialchars($webinar_date_str) ?>
</div>
<a href="register.php?webinar_id=<?= $webinar_id ?>" class="register-button">Register Now </a>
<div class="byline">
By: Philip Daineka, Alex Rubanau, Alexey Vertel
</div> </div>
</div> </div>
<header style="position: absolute; top: 1rem; right: 1rem;"> </div>
<a href="login.php" style="color: #1a202c; text-decoration: none; background-color: #f6e05e; padding: 0.75rem 1.5rem; border-radius: 0.375rem; font-weight: bold; font-size: 1.125rem;">Login</a> </div>
</header> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -25,6 +25,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
// --- DATA CAPTURE --- // --- DATA CAPTURE ---
$email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL); $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
$first_name = filter_input(INPUT_POST, 'first_name', FILTER_SANITIZE_STRING); $first_name = filter_input(INPUT_POST, 'first_name', FILTER_SANITIZE_STRING);
$last_name = filter_input(INPUT_POST, 'last_name', FILTER_SANITIZE_STRING);
$company = filter_input(INPUT_POST, 'company', FILTER_SANITIZE_STRING);
$how_did_you_hear = filter_input(INPUT_POST, 'how_did_you_hear', FILTER_SANITIZE_STRING);
$password = filter_input(INPUT_POST, 'password', FILTER_UNSAFE_RAW); $password = filter_input(INPUT_POST, 'password', FILTER_UNSAFE_RAW);
$confirm_password = filter_input(INPUT_POST, 'confirm_password', FILTER_UNSAFE_RAW); $confirm_password = filter_input(INPUT_POST, 'confirm_password', FILTER_UNSAFE_RAW);
$consent = filter_input(INPUT_POST, 'consent', FILTER_VALIDATE_BOOLEAN); $consent = filter_input(INPUT_POST, 'consent', FILTER_VALIDATE_BOOLEAN);
@ -41,8 +44,14 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$fbclid = filter_input(INPUT_POST, 'fbclid', FILTER_SANITIZE_STRING); $fbclid = filter_input(INPUT_POST, 'fbclid', FILTER_SANITIZE_STRING);
if (!$email || !$consent || !$webinar) { if (!$first_name || !$last_name || !$email) {
$response['error'] = 'Please provide a valid email and agree to the terms.'; $response['error'] = 'Please fill out all required fields.';
echo json_encode($response);
exit;
}
if (!$consent || !$webinar) {
$response['error'] = 'Please agree to the terms.';
echo json_encode($response); echo json_encode($response);
exit; exit;
} }
@ -66,10 +75,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
// Insert attendee // Insert attendee
$sql = "INSERT INTO attendees (webinar_id, name, email, password, timezone, utm_source, utm_medium, utm_campaign, utm_term, utm_content, referrer, gclid, fbclid) $sql = "INSERT INTO attendees (webinar_id, first_name, last_name, email, company, how_did_you_hear, password, timezone, utm_source, utm_medium, utm_campaign, utm_term, utm_content, referrer, gclid, fbclid)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$stmt = db()->prepare($sql); $stmt = db()->prepare($sql);
$stmt->execute([$webinar_id, $first_name, $email, $password_hash, $timezone, $utm_source, $utm_medium, $utm_campaign, $utm_term, $utm_content, $referrer, $gclid, $fbclid]); $stmt->execute([$webinar_id, $first_name, $last_name, $email, $company, $how_did_you_hear, $password_hash, $timezone, $utm_source, $utm_medium, $utm_campaign, $utm_term, $utm_content, $referrer, $gclid, $fbclid]);
$attendee_id = db()->lastInsertId(); $attendee_id = db()->lastInsertId();
// --- SEND CONFIRMATION EMAIL --- // --- SEND CONFIRMATION EMAIL ---