mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-11-09 19:20:09 +01:00
feat: student name popover preview on /repertoire via htmx
This commit is contained in:
1 parent
d961f9533c
commit
ede53746ba
18 files changed
+237
-278
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user