From 663668f344acaa8855f302893d22bc1d59e7c5bc Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Mon, 10 Dec 2018 10:42:54 +0100 Subject: [PATCH] New function getPersonenReihungstest - Loads all persons assigned to a test --- include/reihungstest.class.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/reihungstest.class.php b/include/reihungstest.class.php index 7bc2b67a1..132ec78fa 100644 --- a/include/reihungstest.class.php +++ b/include/reihungstest.class.php @@ -1386,4 +1386,38 @@ class reihungstest extends basis_db return false; } } + + /** + * Laedt alle person_ids, die einem Reihungstest zugeteilt sind + * @param integer $reihungstest_id ID des Reihungstests. + * @return true wenn ok, false im Fehlerfall + */ + public function getPersonenReihungstest($reihungstest_id) + { + $qry = "SELECT + person_id + FROM + public.tbl_rt_person + WHERE + tbl_rt_person.rt_id=".$this->db_add_param($reihungstest_id)." + ORDER BY + person_id"; + if ($result = $this->db_query($qry)) + { + while ($row = $this->db_fetch_object($result)) + { + $obj = new stdClass(); + + $obj->person_id = $row->person_id; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } }