From 9f945b12f81593fc69650b65da4e9a8ed8a76340 Mon Sep 17 00:00:00 2001 From: Manfred Kindl Date: Thu, 28 Mar 2019 15:51:48 +0100 Subject: [PATCH] New function getNextPlacementtestDate --- application/models/crm/Reihungstest_model.php | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/application/models/crm/Reihungstest_model.php b/application/models/crm/Reihungstest_model.php index d0efb8bc8..6102c2b5e 100644 --- a/application/models/crm/Reihungstest_model.php +++ b/application/models/crm/Reihungstest_model.php @@ -473,11 +473,30 @@ class Reihungstest_model extends DB_Model return $this->execQuery($query, array($reihungstest_id)); } + /** + * Loads the date of the next placement test to the given degree program + * @param integer $studiengang_kz Kennzahl of degree program to load the next placement test date + * @return string Returns date of the next placement test + */ + public function getNextPlacementtestDate($studiengang_kz) + { + $query = ' + SELECT * + FROM PUBLIC.tbl_reihungstest + WHERE studiengang_kz = ? + AND datum > now() + ORDER BY datum ASC + LIMIT 1 + '; + + return $this->execQuery($query, array($studiengang_kz)); + } + /** * Loads all placement tests of the given day and optional degree program * @param string $date Date of the tests to be loaded (YYYY-MM-DD) * @param integer $studiengang_kz Optional. Kennzahl of degree program to load - * @return array Returns object array with data of applicants. + * @return array Returns object array with data of placement tests */ public function getTestsOnDate($date, $studiengang_kz = null) {