diff --git a/src/components/Nutzer.svelte b/src/components/Nutzer.svelte index cd19ee7..abd73ad 100644 --- a/src/components/Nutzer.svelte +++ b/src/components/Nutzer.svelte @@ -8,69 +8,59 @@ let klasse; function ausleiher() { const res = $db - .prepare( - ` + .prepare(` SELECT s.name, s.vorname, s.klasse, s.id, m.name as titel FROM ausleihe AS a LEFT JOIN medienexemplar AS x ON (x.id = a.medienexemplar_id) LEFT JOIN medienbezeichnung AS m ON (m.id = x.medienbezeichnung_id) LEFT JOIN schueler AS s ON (s.id = a.schueler_id) - ` - ) + `) .all(); active = 1; return group_by(res, "klasse"); } function ausleiher_vorjahr() { const res = $db - .prepare( - ` - SELECT DISTINCT s.name, s.vorname, s.klasse, s.id + .prepare(` + SELECT s.name, s.vorname, s.klasse, s.id, m.name as titel FROM ausleihe AS a LEFT JOIN medienexemplar AS x ON (x.id = a.medienexemplar_id) LEFT JOIN medienbezeichnung AS m ON (m.id = x.medienbezeichnung_id) LEFT JOIN schueler AS s ON (s.id = a.schueler_id) WHERE a.jahr != s.jahr - ` - ) + `) .all(); active = 2; return group_by(res, "klasse"); } function schueler() { const res = $db - .prepare( - ` + .prepare(` SELECT s.name, s.vorname, s.id, s.klasse FROM schueler AS s - ` - ) + `) .all(); active = 5; return group_by(res, "klasse"); } function nutzer_gesperrt() { const res = $db - .prepare( - ` + .prepare(` SELECT s.name, s.vorname, s.id, s.klasse FROM schueler AS s WHERE s.gesperrt = 1; - ` - ) + `) .all(); active = 3; return group_by(res, "klasse"); } function sonstige_nutzer() { const res = $db - .prepare( - ` + .prepare(` SELECT s.name, s.vorname, s.memo, s.id, s.klasse FROM schueler AS s WHERE s.nichtschueler = 1; - ` - ) + `) .all(); active = 4; return group_by(res, "nichtschueler"); @@ -144,23 +134,27 @@ Name Vorname - Bemerkung - Bemerkung + Bemerkung/Titel - {#each schueler as s, i} + {#each Object.entries(group_by(schueler, "id")) as [id, s], i} { - get_schueler({ id: s.id }); + get_schueler({ id: s[0].id }); $view = Schueler; }}> {i + 1} - {s.name} - {s.vorname} - {s.memo || "–"} - {s.titel || "–"} + {s[0].name} + {s[0].vorname} + {s[0].memo || "–"} + {#each s as ss} + + {/each} + {/each} diff --git a/src/components/Print/Kurs.svelte b/src/components/Print/Kurs.svelte index 10e688a..12ba51d 100644 --- a/src/components/Print/Kurs.svelte +++ b/src/components/Print/Kurs.svelte @@ -35,7 +35,7 @@ Name - Vorame + Vorname Barcode Unterschrift