From f9c92cb6d2cc81020c2d763222a4a6c5c78f9403 Mon Sep 17 00:00:00 2001 From: Nikolaus Krondraf Date: Wed, 12 Aug 2015 14:48:29 +0200 Subject: [PATCH] =?UTF-8?q?Standort-Filter=20f=C3=BCr=20Anwesenheitsliste?= =?UTF-8?q?=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/standort.class.php | 40 +++++++++++++++++++ rdf/anwesenheitsliste.xml.php | 8 +++- .../personen/anwesenheitslisten_barcode.php | 12 ++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/include/standort.class.php b/include/standort.class.php index 1c5a6e9cc..c92691d52 100644 --- a/include/standort.class.php +++ b/include/standort.class.php @@ -638,6 +638,46 @@ class standort extends basis_db } + + /** + * Gibt alle Standorte zurück, die zumindest mit 1 Ort verknüpft sind + * @return true wenn ok, false im Fehlerfall + */ + public function getAllStandorteWithOrt() + { + $qry = "SELECT standort.* + FROM public.tbl_firma AS firma, public.tbl_adresse AS adresse, public.tbl_standort AS standort + WHERE firma.firma_id = standort.firma_id + AND standort.adresse_id = adresse.adresse_id + AND standort.standort_id IN + (SELECT DISTINCT standort_id FROM public.tbl_ort);"; + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $standort = new standort(); + + $standort->standort_id = $row->standort_id; + $standort->firma_id = $row->firma_id; + $standort->adresse_id = $row->adresse_id; + $standort->kurzbz = $row->kurzbz; + $standort->bezeichnung = $row->bezeichnung; + $standort->insertvon = $row->insertvon; + $standort->insertamum = $row->insertamum; + $standort->updatevon = $row->updatevon; + $standort->updateamum = $row->updateamum; + + $this->result[] = $standort; + } + return true; + } + else + { + $this->errormsg="Fehler bei der Abfrage aufgetreten."; + return false; + } + } } diff --git a/rdf/anwesenheitsliste.xml.php b/rdf/anwesenheitsliste.xml.php index 9cc1aaebb..c8021ed82 100644 --- a/rdf/anwesenheitsliste.xml.php +++ b/rdf/anwesenheitsliste.xml.php @@ -36,6 +36,7 @@ isset($_GET['stg_kz']) ? $studiengang = $_GET['stg_kz'] : $studiengang = NULL; isset($_GET['semester']) ? $semester = $_GET['semester'] : $semester = NULL; isset($_GET['lehreinheit']) ? $lehreinheit = $_GET['lehreinheit'] : $lehreinheit = NULL; isset($_GET['fixangestellt']) ? $fixangestellt = $_GET['fixangestellt'] : $fixangestellt = NULL; +isset($_GET['standort']) ? $standort = $_GET['standort'] : $standort = NULL; if($von) $studiensemester = getStudiensemesterFromDatum($von); @@ -48,12 +49,14 @@ $data = array(); */ // Daten der Lehreinheiten ermitteln $qry = "SELECT le.lehreinheit_id, le.lehrveranstaltung_id, lv.lvnr, lv.bezeichnung AS lvbez, stg.bezeichnung AS stgbez, " - . "sp.ort_kurzbz, datum, beginn, ende " + . "sp.ort_kurzbz, datum, beginn, ende, sto.bezeichnung AS standort " . "FROM lehre.tbl_lehreinheit le " . "JOIN lehre.tbl_lehrveranstaltung lv ON lv.lehrveranstaltung_id = le.lehrveranstaltung_id " . "JOIN public.tbl_studiengang stg ON stg.studiengang_kz = lv.studiengang_kz " . "JOIN lehre.tbl_stundenplan sp ON (sp.lehreinheit_id=le.lehreinheit_id) " . "JOIN lehre.tbl_stunde stu ON stu.stunde = sp.stunde " + . "JOIN public.tbl_ort ort ON sp.ort_kurzbz = ort.ort_kurzbz " + . "JOIN public.tbl_standort sto ON ort.standort_id = sto.standort_id " . "WHERE 1=1"; if($studiengang!='') @@ -70,6 +73,8 @@ if(!is_null($stundevon)) $qry.=" AND stu.stunde>=".$db->db_add_param($stundevon); if(!is_null($stundebis)) $qry.=" AND stu.stunde<=".$db->db_add_param($stundebis); +if($standort) + $qry.=" AND sto.standort_id=".$db->db_add_param($standort); $qry .= " ORDER BY datum, beginn"; if($db->db_query($qry)) @@ -160,6 +165,7 @@ foreach($data as $lehreinheit_id => $value) echo "\n "; echo "\n lvnr."]]>"; echo "\n "; + echo "\n standort."]]>"; echo "\n ort_kurzbz."]]>"; echo "\n datum))."]]>"; echo "\n beginn, 0, 5)."]]>"; diff --git a/vilesci/personen/anwesenheitslisten_barcode.php b/vilesci/personen/anwesenheitslisten_barcode.php index f22416232..426e37ded 100644 --- a/vilesci/personen/anwesenheitslisten_barcode.php +++ b/vilesci/personen/anwesenheitslisten_barcode.php @@ -22,9 +22,12 @@ require_once('../../config/vilesci.config.inc.php'); require_once('../../include/functions.inc.php'); require_once('../../include/studiengang.class.php'); require_once('../../include/stunde.class.php'); +require_once('../../include/standort.class.php'); $studiengang = new studiengang; $studiengang->getAll("typ, kurzbz"); +$standort = new standort; +$standort->getAllStandorteWithOrt(); ?> @@ -147,6 +150,15 @@ $studiengang->getAll("typ, kurzbz"); + + Standort + + + +