prepare("SELECT * FROM seminars WHERE schedule_token=? AND is_finalized=1");
$st->execute(array($token));
$seminar = $st->fetch();
} elseif (isset($_GET['id'])) {
$id = (int)$_GET['id'];
$st = $db->prepare("SELECT * FROM seminars WHERE id=?");
$st->execute(array($id));
$seminar = $st->fetch();
}
if (!$seminar) {
?>
Schedule not found
Schedule not found. The link may be incorrect, or the schedule has not been finalized yet.
Return home
prepare("SELECT * FROM slots WHERE seminar_id=? ORDER BY sort_order ASC, id ASC");
$st->execute(array($seminar['id']));
$slots = $st->fetchAll();
// assignments: slot_id => array of {person_name, office_number}
$assignments_map = array();
if (!empty($slots)) {
$slot_ids = array();
foreach ($slots as $sl) { $slot_ids[] = $sl['id']; }
$placeholders = implode(',', array_fill(0, count($slot_ids), '?'));
$ast = $db->prepare(
"SELECT slot_id, person_name, office_number FROM assignments
WHERE slot_id IN ($placeholders)
ORDER BY slot_id ASC, person_name ASC"
);
$ast->execute($slot_ids);
foreach ($ast->fetchAll() as $a) {
$assignments_map[$a['slot_id']][] = array(
'person_name' => $a['person_name'],
'office_number' => $a['office_number'],
);
}
}
/* ---------------------------------------------------------------
Page output — clean, shareable layout
--------------------------------------------------------------- */
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo 'Schedule: ' . h($seminar['speaker_name']) . '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '