Auto commit: 2025-11-11T12:11:36.163Z

This commit is contained in:
Flatlogic Bot 2025-11-11 12:11:36 +00:00
parent 40f88f8b9f
commit 57f5b1e61b
7 changed files with 317 additions and 142 deletions

41
assets/css/custom.css Normal file
View File

@ -0,0 +1,41 @@
body {
background-color: #F4F7F6;
color: #333333;
font-family: 'Roboto', sans-serif;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Poppins', sans-serif;
}
.hero {
background: linear-gradient(45deg, #4A90E2, #50E3C2);
color: white;
padding: 4rem 2rem;
border-radius: 0 0 1rem 1rem;
}
.schedule-item {
background-color: #FFFFFF;
border-radius: 0.5rem;
padding: 1.5rem;
margin-bottom: 1rem;
border-left: 5px solid #4A90E2;
transition: transform 0.2s ease-in-out;
}
.schedule-item:hover {
transform: translateY(-5px);
}
.schedule-time {
font-weight: bold;
color: #4A90E2;
}
.footer {
padding: 2rem 0;
margin-top: 2rem;
background-color: #FFFFFF;
}

2
assets/js/main.js Normal file
View File

@ -0,0 +1,2 @@
// No custom JS needed for this static page yet.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

112
db/setup.php Normal file
View File

@ -0,0 +1,112 @@
<?php
// This script sets up the database tables and seeds them with initial data.
require_once __DIR__ . '/config.php';
function setup_database() {
try {
$pdo = db();
// Create sessions table if it doesn't exist
$pdo->exec("CREATE TABLE IF NOT EXISTS sessions (
id INT AUTO_INCREMENT PRIMARY KEY,
time VARCHAR(255) NOT NULL,
title VARCHAR(255) NOT NULL,
speaker VARCHAR(255) NOT NULL,
description TEXT
)");
// Create speakers table if it doesn't exist
$pdo->exec("CREATE TABLE IF NOT EXISTS speakers (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
bio TEXT,
photo_url VARCHAR(255),
slug VARCHAR(255) UNIQUE NOT NULL
)");
// Check if sessions table is empty
$stmt = $pdo->query("SELECT COUNT(*) FROM sessions");
$count = $stmt->fetchColumn();
if ($count == 0) {
// Schedule data to insert
$seed_schedule = [
[
'time' => '9:00 AM - 10:00 AM',
'title' => 'Opening Keynote',
'speaker' => 'Jane Doe',
'description' => 'A look at the future of web development and the latest trends in the industry.'
],
[
'time' => '10:15 AM - 11:15 AM',
'title' => 'The Power of Modern PHP',
'speaker' => 'John Smith',
'description' => 'Exploring the new features of PHP 8 and how to write more efficient and readable code.'
],
[
'time' => '11:30 AM - 12:30 PM',
'title' => 'Frontend Magic with Vanilla JS',
'speaker' => 'Emily White',
'description' => 'Building interactive and dynamic user interfaces without the need for heavy frameworks.'
],
[
'time' => '1:30 PM - 2:30 PM',
'title' => 'Securing Your Web Applications',
'speaker' => 'Michael Brown',
'description' => 'Best practices for protecting your applications from common vulnerabilities.'
]
];
$stmt = $pdo->prepare("INSERT INTO sessions (time, title, speaker, description) VALUES (:time, :title, :speaker, :description)");
foreach ($seed_schedule as $item) {
$stmt->execute($item);
}
}
// Check if speakers table is empty
$stmt = $pdo->query("SELECT COUNT(*) FROM speakers");
$count = $stmt->fetchColumn();
if ($count == 0) {
// Speaker data to insert
$seed_speakers = [
[
'name' => 'Jane Doe',
'bio' => 'Jane Doe is a renowned expert in web development with over 15 years of experience. She is a frequent speaker at international conferences and has authored several books on the subject.',
'photo_url' => 'https://i.pravatar.cc/150?u=jane_doe',
'slug' => 'jane-doe'
],
[
'name' => 'John Smith',
'bio' => 'John Smith is a core contributor to the PHP language and has been instrumental in its recent developments. He is passionate about open source and loves to share his knowledge with the community.',
'photo_url' => 'https://i.pravatar.cc/150?u=john_smith',
'slug' => 'john-smith'
],
[
'name' => 'Emily White',
'bio' => 'Emily White is a frontend developer who specializes in creating beautiful and performant user interfaces. She is a strong advocate for web standards and accessibility.',
'photo_url' => 'https://i.pravatar.cc/150?u=emily_white',
'slug' => 'emily-white'
],
[
'name' => 'Michael Brown',
'bio' => 'Michael Brown is a security researcher and ethical hacker. He has helped numerous companies secure their web applications and is a regular trainer at security bootcamps.',
'photo_url' => 'https://i.pravatar.cc/150?u=michael_brown',
'slug' => 'michael-brown'
]
];
$stmt = $pdo->prepare("INSERT INTO speakers (name, bio, photo_url, slug) VALUES (:name, :bio, :photo_url, :slug)");
foreach ($seed_speakers as $speaker) {
$stmt->execute($speaker);
}
}
} catch (PDOException $e) {
// In a real app, log this error and show a generic message
die('DB Setup Error: ' . $e->getMessage());
}
}
setup_database();

225
index.php
View File

@ -1,150 +1,93 @@
<?php <?php
declare(strict_types=1); require_once __DIR__ . '/db/setup.php';
@ini_set('display_errors', '1');
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$phpVersion = PHP_VERSION; try {
$now = date('Y-m-d H:i:s'); $pdo = db();
// Fetch schedule from the database
$stmt = $pdo->query("SELECT time, title, speaker, description FROM sessions ORDER BY id");
$schedule = $stmt->fetchAll();
// Fetch speakers from the database to create a lookup table for slugs
$stmt = $pdo->query("SELECT name, slug FROM speakers");
$speakers = $stmt->fetchAll(PDO::FETCH_KEY_PAIR);
} catch (PDOException $e) {
$schedule = [];
$speakers = [];
$db_error = "Database error: " . $e->getMessage();
}
?> ?>
<!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" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Style</title> <title>Web App Summit</title>
<?php <meta name="description" content="The premier event for web application developers and enthusiasts.">
// Read project preview data from environment <meta name="keywords" content="web app summit, web applications, conference, tech event, javascript, php, html, css, developers, Built with Flatlogic Generator">
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? ''; <meta property="og:title" content="Web App Summit">
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; <meta property="og:description" content="The premier event for web application developers and enthusiasts.">
?> <meta property="og:image" content="">
<?php if ($projectDescription): ?> <meta name="twitter:card" content="summary_large_image">
<!-- Meta description --> <meta name="twitter:image" content="">
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
<!-- Open Graph meta tags --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" /> <link rel="preconnect" href="https://fonts.googleapis.com">
<!-- Twitter meta tags --> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" /> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<?php endif; ?> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<?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">
<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 {
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 {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}
.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;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hint {
opacity: 0.9;
}
.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;
}
h1 {
font-size: 3rem;
font-weight: 700;
margin: 0 0 1rem;
letter-spacing: -1px;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
}
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;
}
</style>
</head> </head>
<body> <body>
<main>
<div class="card"> <header class="p-3 mb-3 border-bottom bg-white">
<h1>Analyzing your requirements and generating your website…</h1> <div class="container">
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes"> <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<span class="sr-only">Loading…</span> <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-dark text-decoration-none">
</div> <span class="fs-4">Web App Summit</span>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p> </a>
<p class="hint">This page will update automatically as the plan is implemented.</p> </div>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p> </div>
</div> </header>
</main>
<footer> <main class="container">
Page updated: <?= htmlspecialchars($now) ?> (UTC) <div class="hero text-center mb-5">
</footer> <h1 class="display-4 fw-bold">Welcome to the Web App Summit</h1>
<p class="lead">The premier event for web application developers and enthusiasts.</p>
</div>
<h2 class="text-center mb-4">Event Schedule</h2>
<div class="schedule">
<?php if (isset($db_error)): ?>
<div class="alert alert-danger"><?php echo $db_error; ?></div>
<?php endif; ?>
<?php if (empty($schedule) && !isset($db_error)): ?>
<div class="alert alert-info">The schedule is not available at the moment. Please check back later.</div>
<?php else: ?>
<?php foreach ($schedule as $item): ?>
<div class="schedule-item">
<div class="row">
<div class="col-md-2 schedule-time"><?php echo htmlspecialchars($item['time']); ?></div>
<div class="col-md-10">
<h5><?php echo htmlspecialchars($item['title']); ?></h5>
<p class="mb-1"><strong>Speaker:</strong> <a href="speaker.php?slug=<?php echo htmlspecialchars($speakers[$item['speaker']] ?? ''); ?>"><?php echo htmlspecialchars($item['speaker']); ?></a></p>
<p><?php echo htmlspecialchars($item['description']); ?></p>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</main>
<footer class="footer text-center">
<div class="container">
<span class="text-muted">&copy; <?php echo date("Y"); ?> Web App Summit. All Rights Reserved.</span>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body> </body>
</html> </html>

77
speaker.php Normal file
View File

@ -0,0 +1,77 @@
<?php
require_once __DIR__ . '/db/config.php';
$speaker_slug = $_GET['slug'] ?? '';
$speaker = null;
$error = '';
if (empty($speaker_slug)) {
$error = 'No speaker specified.';
} else {
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT name, bio, photo_url FROM speakers WHERE slug = ?");
$stmt->execute([$speaker_slug]);
$speaker = $stmt->fetch();
if (!$speaker) {
$error = 'Speaker not found.';
}
} catch (PDOException $e) {
$error = 'Database error: ' . $e->getMessage();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $speaker ? htmlspecialchars($speaker['name']) : 'Speaker Details'; ?> - Web App Summit</title>
<meta name="description" content="Details for <?php echo $speaker ? htmlspecialchars($speaker['name']) : 'a speaker'; ?> at the Web App Summit.">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<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&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<header class="p-3 mb-3 border-bottom bg-white">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-dark text-decoration-none">
<span class="fs-4">Web App Summit</span>
</a>
</div>
</div>
</header>
<main class="container">
<?php if ($error):
<div class="alert alert-danger"><?php echo $error; ?></div>
<a href="/" class="btn btn-primary">Back to Schedule</a>
<?php elseif ($speaker):
<div class="row">
<div class="col-md-4">
<img src="<?php echo htmlspecialchars($speaker['photo_url']); ?>" alt="<?php echo htmlspecialchars($speaker['name']); ?>" class="img-fluid rounded-circle">
</div>
<div class="col-md-8">
<h1><?php echo htmlspecialchars($speaker['name']); ?></h1>
<p class="lead"><?php echo nl2br(htmlspecialchars($speaker['bio'])); ?></p>
<a href="/" class="btn btn-primary mt-3">Back to Schedule</a>
</div>
</div>
<?php endif; ?>
</main>
<footer class="footer text-center">
<div class="container">
<span class="text-muted">&copy; <?php echo date("Y"); ?> Web App Summit. All Rights Reserved.</span>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>