From a4b9b7f899bf4e244036847308bbe121fa221405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 29 Oct 2012 14:10:31 +0000 Subject: [PATCH] =?UTF-8?q?Unsch=C3=B6ne=20PHP=20Warnmeldung=20entfernt=20?= =?UTF-8?q?bei=20Excel=20Export=20ohne=20Studierende=20im=20ausgew=C3=A4hl?= =?UTF-8?q?ten=20Semester?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/statistik/studentenexport.xls.php | 20 ++++++++++------- .../statistik/studentenexportextended.xls.php | 22 +++++++++++-------- 2 files changed, 25 insertions(+), 17 deletions(-) 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++; + } } }