1 version
This commit is contained in:
parent
c41f343c47
commit
dbf75ca780
BIN
assets/pasted-20251016-141336-dce056a4.png
Normal file
BIN
assets/pasted-20251016-141336-dce056a4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
BIN
assets/pasted-20251016-141746-e994507c.jpg
Normal file
BIN
assets/pasted-20251016-141746-e994507c.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
BIN
assets/pasted-20251016-142345-48170932.png
Normal file
BIN
assets/pasted-20251016-142345-48170932.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 501 KiB |
BIN
assets/vm-shot-2025-10-16T14-15-36-087Z.jpg
Normal file
BIN
assets/vm-shot-2025-10-16T14-15-36-087Z.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
26
db/migrate.php
Normal file
26
db/migrate.php
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
<?php
|
||||
require_once 'config.php';
|
||||
|
||||
try {
|
||||
// Connect without specifying a database
|
||||
$pdo = new PDO('mysql:host='.DB_HOST, DB_USER, DB_PASS, [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
]);
|
||||
$pdo->exec('CREATE DATABASE IF NOT EXISTS '.DB_NAME);
|
||||
echo "Database created or already exists." . PHP_EOL;
|
||||
|
||||
// Now connect to the specific database
|
||||
$pdo = db();
|
||||
$migrations = glob(__DIR__ . '/migrations/*.sql');
|
||||
sort($migrations);
|
||||
|
||||
foreach ($migrations as $migration) {
|
||||
$sql = file_get_contents($migration);
|
||||
$pdo->exec($sql);
|
||||
echo "Executed migration: $migration" . PHP_EOL;
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
die("Database migration failed: " . $e->getMessage());
|
||||
}
|
||||
9
db/migrations/001_create_webinars_table.sql
Normal file
9
db/migrations/001_create_webinars_table.sql
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS webinars (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
description TEXT,
|
||||
presenter VARCHAR(255),
|
||||
scheduled_at DATETIME NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
10
db/migrations/002_create_attendees_table.sql
Normal file
10
db/migrations/002_create_attendees_table.sql
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS attendees (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
webinar_id INT NOT NULL,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
company VARCHAR(255),
|
||||
registered_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (webinar_id) REFERENCES webinars(id) ON DELETE CASCADE
|
||||
);
|
||||
5
db/migrations/003_seed_webinars_table.sql
Normal file
5
db/migrations/003_seed_webinars_table.sql
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
INSERT INTO webinars (title, description, presenter, scheduled_at) VALUES
|
||||
('Getting Started with Docker', 'Learn the fundamentals of Docker and containerization.', 'John Doe', '2025-11-15 10:00:00'),
|
||||
('Mastering Kubernetes', 'A deep dive into Kubernetes for container orchestration.', 'Jane Smith', '2025-11-20 14:00:00'),
|
||||
('CI/CD with Jenkins', 'Automate your build, test, and deployment pipeline with Jenkins.', 'Peter Jones', '2025-12-01 11:30:00');
|
||||
185
index.php
185
index.php
@ -1,150 +1,93 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Professional Vibe-Coding Webinar</title>
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
background-color: #1a202c;
|
||||
color: #e2e8f0;
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
.container {
|
||||
max-width: 800px;
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
.schedule-block {
|
||||
background-color: #2d3748;
|
||||
border-radius: 0.5rem;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
border: 1px solid #4a5568;
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
h2 {
|
||||
color: #f6e05e;
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 1.5rem 0;
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
li {
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
.date-time {
|
||||
font-size: 1.25rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
.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;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
.register-button:hover {
|
||||
background-color: #f6d32d;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
.byline {
|
||||
font-size: 1rem;
|
||||
color: #a0aec0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
<div class="container">
|
||||
<h1 style="font-size: 2.5rem; font-weight: bold; color: #f6e05e; margin-bottom: 0.5rem;">Professional vibe-coding webinar</h1>
|
||||
<p style="font-size: 1.25rem; color: #a0aec0; margin-bottom: 2rem;">by Flatlogic</p>
|
||||
<div class="schedule-block">
|
||||
<h2>Schedule</h2>
|
||||
<ul>
|
||||
<li>• Intro ~10 min</li>
|
||||
<li>• Creating Apps ~40-50 min</li>
|
||||
<li>• Q&A</li>
|
||||
</ul>
|
||||
<div class="date-time">
|
||||
Monday, November 3 • At 6.00 PM PST
|
||||
</div>
|
||||
<a href="register.php" class="register-button">Register Now →</a>
|
||||
<div class="byline">
|
||||
By: Philip Daineka, Alex Rubanau, Alexey Vertel
|
||||
</div>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
191
register.php
Normal file
191
register.php
Normal file
@ -0,0 +1,191 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
require_once 'db/config.php';
|
||||
|
||||
$pdo = db();
|
||||
$webinar_id = filter_input(INPUT_GET, 'webinar_id', FILTER_VALIDATE_INT);
|
||||
$webinar = null;
|
||||
$feedback = [];
|
||||
|
||||
// Fetch webinar details
|
||||
if ($webinar_id) {
|
||||
try {
|
||||
$stmt = $pdo->prepare('SELECT id, title, scheduled_at FROM webinars WHERE id = ?');
|
||||
$stmt->execute([$webinar_id]);
|
||||
$webinar = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
error_log("Webinar fetch error: " . $e->getMessage());
|
||||
// Don't expose error details to user
|
||||
}
|
||||
}
|
||||
|
||||
// Handle form submission
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$name = trim($_POST['name'] ?? '');
|
||||
$email = filter_var(trim($_POST['email'] ?? ''), FILTER_VALIDATE_EMAIL);
|
||||
$submitted_webinar_id = filter_input(INPUT_POST, 'webinar_id', FILTER_VALIDATE_INT);
|
||||
|
||||
if (!$name || !$email || !$submitted_webinar_id) {
|
||||
$feedback = ['type' => 'error', 'message' => 'Please fill in all fields with valid information.'];
|
||||
} else {
|
||||
try {
|
||||
$stmt = $pdo->prepare('INSERT INTO attendees (webinar_id, name, email) VALUES (?, ?, ?)');
|
||||
$stmt->execute([$submitted_webinar_id, $name, $email]);
|
||||
$feedback = ['type' => 'success', 'message' => 'Thank you for registering! A confirmation has been sent to your email.'];
|
||||
// In a real app, you would trigger an email here.
|
||||
} catch (PDOException $e) {
|
||||
error_log("Registration error: " . $e->getMessage());
|
||||
if ($e->errorInfo[1] == 1062) { // Duplicate entry
|
||||
$feedback = ['type' => 'error', 'message' => 'This email address has already been registered for this webinar.'];
|
||||
} else {
|
||||
$feedback = ['type' => 'error', 'message' => 'An error occurred during registration. Please try again.'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Register for Webinar</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color: #1A2035;
|
||||
--primary-color: #F2A900;
|
||||
--text-color: #FFFFFF;
|
||||
--card-bg: #2A3045;
|
||||
--error-color: #E57373;
|
||||
--success-color: #81C784;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
background-color: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.container {
|
||||
max-width: 500px;
|
||||
width: 100%;
|
||||
padding: 2rem;
|
||||
}
|
||||
.form-container {
|
||||
background: var(--card-bg);
|
||||
padding: 2.5rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-size: 2rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.5rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
.webinar-info {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
color: #E0E0E0;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
input[type="text"], input[type="email"] {
|
||||
width: 100%;
|
||||
padding: 0.8rem;
|
||||
border: 1px solid #4A5062;
|
||||
border-radius: 8px;
|
||||
background-color: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
font-family: 'Poppins', sans-serif;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
padding: 0.9rem;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background-color: var(--primary-color);
|
||||
color: var(--bg-color);
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
.submit-btn:hover {
|
||||
background-color: #FFC107;
|
||||
}
|
||||
.feedback {
|
||||
padding: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.feedback.success {
|
||||
background-color: var(--success-color);
|
||||
color: #1B5E20;
|
||||
}
|
||||
.feedback.error {
|
||||
background-color: var(--error-color);
|
||||
color: #C62828;
|
||||
}
|
||||
.back-link {
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin-top: 2rem;
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="form-container">
|
||||
<?php if ($feedback && $feedback['type'] === 'success'): ?>
|
||||
<h1>Registration Successful!</h1>
|
||||
<div class="feedback success"><?= htmlspecialchars($feedback['message']) ?></div>
|
||||
<a href="index.php" class="back-link">← Back to Webinars</a>
|
||||
<?php elseif ($webinar): ?>
|
||||
<h1>Register for Webinar</h1>
|
||||
<p class="webinar-info">You are registering for: <strong><?= htmlspecialchars($webinar['title']) ?></strong></p>
|
||||
|
||||
<?php if ($feedback && $feedback['type'] === 'error'): ?>
|
||||
<div class="feedback error"><?= htmlspecialchars($feedback['message']) ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="register.php?webinar_id=<?= $webinar_id ?>" method="POST">
|
||||
<input type="hidden" name="webinar_id" value="<?= $webinar_id ?>">
|
||||
<div class="form-group">
|
||||
<label for="name">Full Name</label>
|
||||
<input type="text" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Email Address</label>
|
||||
<input type="email" id="email" name="email" required>
|
||||
</div>
|
||||
<button type="submit" class="submit-btn">Register Now</button>
|
||||
</form>
|
||||
<a href="index.php" class="back-link">← Cancel</a>
|
||||
<?php else: ?>
|
||||
<h1>Webinar Not Found</h1>
|
||||
<p style="text-align:center">The requested webinar could not be found.</p>
|
||||
<a href="index.php" class="back-link">← Back to Webinars</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user