35643-vm/index.php
2025-11-11 12:11:36 +00:00

93 lines
4.1 KiB
PHP

<?php
require_once __DIR__ . '/db/setup.php';
try {
$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>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web App Summit</title>
<meta name="description" content="The premier event for web application developers and enthusiasts.">
<meta name="keywords" content="web app summit, web applications, conference, tech event, javascript, php, html, css, developers, Built with Flatlogic Generator">
<meta property="og:title" content="Web App Summit">
<meta property="og:description" content="The premier event for web application developers and enthusiasts.">
<meta property="og:image" content="">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="">
<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">
<div class="hero text-center mb-5">
<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>
</html>