diff --git a/homepage/participo/api/trainees.php b/homepage/participo/api/trainees.php index 358fde3..8bf39de 100644 --- a/homepage/participo/api/trainees.php +++ b/homepage/participo/api/trainees.php @@ -27,7 +27,6 @@ function get() return $wkSqlResponse; } - authorize(); $wkSqlResponse = get(); diff --git a/homepage/participo/index.js b/homepage/participo/index.js index 1c3b19f..ade2266 100644 --- a/homepage/participo/index.js +++ b/homepage/participo/index.js @@ -1,9 +1,13 @@ // What to do when the document is loaded. -document.addEventListener('DOMContentLoaded', function () { - // init materialize elements - initModals(); - initSidenav(); -}); +document.addEventListener( + 'DOMContentLoaded' + , function () { + // init materialize elements + initModals(); + initSidenav(); + initSelects(); + } +); function initSidenav() { var sidenavElements = document.querySelectorAll('.sidenav'); diff --git a/homepage/participo/index.php b/homepage/participo/index.php index 8d0b7eb..14b1878 100644 --- a/homepage/participo/index.php +++ b/homepage/participo/index.php @@ -1,6 +1,4 @@ - +
diff --git a/homepage/participo/lib/participoLib/user.php b/homepage/participo/lib/participoLib/user.php index 17656db..fc0f19c 100644 --- a/homepage/participo/lib/participoLib/user.php +++ b/homepage/participo/lib/participoLib/user.php @@ -325,4 +325,27 @@ SQL; } return User::fromDbArray($response[0]); } + + public static function loadFromDbByAttribute(int $attributeId){ + $query = + "SELECT DISTINCT" . + " `wkParticipo_Users`.* " . + " FROM `wkParticipo_Users`" . + " JOIN `wkParticipo_user<=>userAttributes`" . + " ON `wkParticipo_user<=>userAttributes`.`userId` = `wkParticipo_Users`.`id`" . + " WHERE `wkParticipo_user<=>userAttributes`.`attributeId` = 4". + " ORDER BY `wkParticipo_Users`.`id` ASC;"; + + $response = dbConnector::query($query); + + // Postprocessing + // - convert the comma separated list into an array + foreach ($response as &$user) { + $user["eMail"] = explode(",", $user["eMail"]); + foreach ($user["eMail"] as &$email) { + $email = trim($email); + } + } + return $response; + } } diff --git a/homepage/participo/pmelo.inc.php b/homepage/participo/pmelo.inc.php new file mode 100644 index 0000000..281ab08 --- /dev/null +++ b/homepage/participo/pmelo.inc.php @@ -0,0 +1,16 @@ + diff --git a/homepage/participo/pmelo.php b/homepage/participo/pmelo.php new file mode 100644 index 0000000..faf1ccf --- /dev/null +++ b/homepage/participo/pmelo.php @@ -0,0 +1,57 @@ + + + + + + + + + + + + + +