diff --git a/content/statistik/anwesenheitsliste.php b/content/statistik/anwesenheitsliste.php index 9b0bdc359..e90e13ccd 100644 --- a/content/statistik/anwesenheitsliste.php +++ b/content/statistik/anwesenheitsliste.php @@ -26,6 +26,7 @@ require_once('../../vilesci/config.inc.php'); require_once('../../include/functions.inc.php'); require_once('../../include/datum.class.php'); require_once('../../include/studiengang.class.php'); +require_once('../../include/akte.class.php'); if (!$conn = pg_pconnect(CONN_STRING)) $error_msg='Es konnte keine Verbindung zum Server aufgebaut werden!'; @@ -89,11 +90,11 @@ if(isset($_GET['prestudent_id'])) $idstring.=','; $idstring.="'$id'"; } - $qry = "SELECT * FROM (SELECT distinct on(person_id) foto, vorname, nachname, person_id, prestudent_id, tbl_prestudent.studiengang_kz, semester, verband, gruppe FROM public.tbl_person JOIN public.tbl_prestudent USING(person_id) LEFT JOIN public.tbl_student USING(prestudent_id) WHERE prestudent_id in($idstring)) foo ORDER BY nachname, vorname"; + $qry = "SELECT distinct on(person_id) foto, vorname, nachname, person_id, prestudent_id, tbl_prestudent.studiengang_kz, semester, verband, gruppe FROM public.tbl_person JOIN public.tbl_prestudent USING(person_id) LEFT JOIN public.tbl_student USING(prestudent_id) WHERE prestudent_id in($idstring)"; } else { - $qry = "SELECT * FROM (SELECT + $qry = "SELECT distinct on(person_id) foto, vorname, nachname, person_id, tbl_studentlehrverband.studiengang_kz, tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe FROM campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid) @@ -106,35 +107,38 @@ else if($lehreinheit_id!='') $qry.=" AND lehreinheit_id='".addslashes($lehreinheit_id)."'"; - - $qry.=' ORDER BY person_id) foo ORDER BY nachname, vorname'; } echo '