77 lines
3.1 KiB
PHP
77 lines
3.1 KiB
PHP
<?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">© <?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>
|