feat: student name popover preview on /repertoire via htmx

This commit is contained in:
Pontoporeia
2026-04-24 13:11:15 +02:00
parent d961f9533c
commit ede53746ba
18 changed files with 237 additions and 278 deletions

View File

@@ -455,6 +455,24 @@ class Database {
return $stmt->fetchAll();
}
/**
* Fetch all published theses for a given author name.
* Returns rows of [id => int, title => string].
*/
public function getThesesByAuthorName(string $name): array {
$stmt = $this->pdo->prepare(
"SELECT t.id, t.title
FROM theses t
JOIN thesis_authors ta ON ta.thesis_id = t.id
JOIN authors a ON a.id = ta.author_id
WHERE t.is_published = 1
AND a.name = ?
ORDER BY t.year DESC, t.title ASC"
);
$stmt->execute([$name]);
return $stmt->fetchAll();
}
public function getAvailableYears() {
$sql = "SELECT DISTINCT year FROM theses WHERE is_published = 1 ORDER BY year DESC";
$stmt = $this->pdo->query($sql);