diff --git a/content/statistik/studentenexport.xls.php b/content/statistik/studentenexport.xls.php index f0f302687..4930b1f50 100644 --- a/content/statistik/studentenexport.xls.php +++ b/content/statistik/studentenexport.xls.php @@ -184,18 +184,22 @@ loadVariables($user); $prestudent_ids .= "'".addslashes($id)."'"; } } - // Student holen - $qry = "SELECT *, (SELECT UPPER(typ || kurzbz) FROM public.tbl_studiengang WHERE studiengang_kz=tbl_prestudent.studiengang_kz) as stgbez FROM public.tbl_prestudent JOIN public.tbl_person USING(person_id) LEFT JOIN public.tbl_student USING(prestudent_id) WHERE prestudent_id in($prestudent_ids) ORDER BY nachname, vorname"; - - if($result = $db->db_query($qry)) + + if($prestudent_ids!='') { - while($row = $db->db_fetch_object($result)) + // Student holen + $qry = "SELECT *, (SELECT UPPER(typ || kurzbz) FROM public.tbl_studiengang WHERE studiengang_kz=tbl_prestudent.studiengang_kz) as stgbez FROM public.tbl_prestudent JOIN public.tbl_person USING(person_id) LEFT JOIN public.tbl_student USING(prestudent_id) WHERE prestudent_id in($prestudent_ids) ORDER BY nachname, vorname"; + + if($result = $db->db_query($qry)) { - draw_content($row); - $zeile++; + while($row = $db->db_fetch_object($result)) + { + draw_content($row); + $zeile++; + } } } - + function draw_content($row) { global $maxlength, $datum_obj; diff --git a/content/statistik/studentenexportextended.xls.php b/content/statistik/studentenexportextended.xls.php index 6d6963f7b..a4ed738dc 100644 --- a/content/statistik/studentenexportextended.xls.php +++ b/content/statistik/studentenexportextended.xls.php @@ -178,17 +178,21 @@ loadVariables($user); $prestudent_ids .= "'".addslashes($id)."'"; } } - // Student holen - $qry = "SELECT *, tbl_prestudent.studiengang_kz as prestgkz, (SELECT UPPER(typ || kurzbz) FROM public.tbl_studiengang WHERE studiengang_kz=tbl_prestudent.studiengang_kz) as stgbez - FROM public.tbl_prestudent JOIN public.tbl_person USING(person_id) LEFT JOIN public.tbl_student USING(prestudent_id) - WHERE prestudent_id in($prestudent_ids) ORDER BY nachname, vorname"; - - if($db->db_query($qry)) + + if($prestudent_ids!='') { - while($row = $db->db_fetch_object()) + // Student holen + $qry = "SELECT *, tbl_prestudent.studiengang_kz as prestgkz, (SELECT UPPER(typ || kurzbz) FROM public.tbl_studiengang WHERE studiengang_kz=tbl_prestudent.studiengang_kz) as stgbez + FROM public.tbl_prestudent JOIN public.tbl_person USING(person_id) LEFT JOIN public.tbl_student USING(prestudent_id) + WHERE prestudent_id in($prestudent_ids) ORDER BY nachname, vorname"; + + if($db->db_query($qry)) { - draw_content($row); - $zeile++; + while($row = $db->db_fetch_object()) + { + draw_content($row); + $zeile++; + } } }