diff --git a/assets/pasted-20251016-141336-dce056a4.png b/assets/pasted-20251016-141336-dce056a4.png new file mode 100644 index 0000000..08e29c8 Binary files /dev/null and b/assets/pasted-20251016-141336-dce056a4.png differ diff --git a/assets/pasted-20251016-141746-e994507c.jpg b/assets/pasted-20251016-141746-e994507c.jpg new file mode 100644 index 0000000..a20a081 Binary files /dev/null and b/assets/pasted-20251016-141746-e994507c.jpg differ diff --git a/assets/pasted-20251016-142345-48170932.png b/assets/pasted-20251016-142345-48170932.png new file mode 100644 index 0000000..1a4cc15 Binary files /dev/null and b/assets/pasted-20251016-142345-48170932.png differ diff --git a/assets/vm-shot-2025-10-16T14-15-36-087Z.jpg b/assets/vm-shot-2025-10-16T14-15-36-087Z.jpg new file mode 100644 index 0000000..a20a081 Binary files /dev/null and b/assets/vm-shot-2025-10-16T14-15-36-087Z.jpg differ diff --git a/db/migrate.php b/db/migrate.php new file mode 100644 index 0000000..b922e8f --- /dev/null +++ b/db/migrate.php @@ -0,0 +1,26 @@ + + 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()); +} diff --git a/db/migrations/001_create_webinars_table.sql b/db/migrations/001_create_webinars_table.sql new file mode 100644 index 0000000..415ab4c --- /dev/null +++ b/db/migrations/001_create_webinars_table.sql @@ -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 +); diff --git a/db/migrations/002_create_attendees_table.sql b/db/migrations/002_create_attendees_table.sql new file mode 100644 index 0000000..b78e06f --- /dev/null +++ b/db/migrations/002_create_attendees_table.sql @@ -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 +); diff --git a/db/migrations/003_seed_webinars_table.sql b/db/migrations/003_seed_webinars_table.sql new file mode 100644 index 0000000..7f7ba8e --- /dev/null +++ b/db/migrations/003_seed_webinars_table.sql @@ -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'); diff --git a/index.php b/index.php index 7205f3d..30caa1e 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,93 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + Professional Vibe-Coding Webinar + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+
+

Professional vibe-coding webinar

+

by Flatlogic

+
+

Schedule

+
    +
  • • Intro ~10 min
  • +
  • • Creating Apps ~40-50 min
  • +
  • • Q&A
  • +
+
+ Monday, November 3 • At 6.00 PM PST +
+ Register Now → + +
-
- - + \ No newline at end of file diff --git a/register.php b/register.php new file mode 100644 index 0000000..ddf5093 --- /dev/null +++ b/register.php @@ -0,0 +1,191 @@ +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.']; + } + } + } +} + +?> + + + + + + Register for Webinar + + + + + + +
+
+ +

Registration Successful!

+ + ← Back to Webinars + +

Register for Webinar

+

You are registering for:

+ + + + + +
+ +
+ + +
+
+ + +
+ +
+ ← Cancel + +

Webinar Not Found

+

The requested webinar could not be found.

+ ← Back to Webinars + +
+
+ + \ No newline at end of file