diff --git a/homepage/participo/attendance.php b/homepage/participo/attendance.php index a053a52..773eb87 100644 --- a/homepage/participo/attendance.php +++ b/homepage/participo/attendance.php @@ -48,66 +48,66 @@ setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); /** * Datastructure and interface for an user */ - class User - { - private $id = null; - private $familyName = null; - private $givenName = null; + // class User + // { + // private $id = null; + // private $familyName = null; + // private $givenName = null; - private $attributes = null; + // private $attributes = null; - public function __construct($id, $familyName, $givenName) - { - $this->id = (int)$id; - $this->familyName = $familyName; - $this->givenName = $givenName; - } + // public function __construct($id, $familyName, $givenName) + // { + // $this->id = (int)$id; + // $this->familyName = $familyName; + // $this->givenName = $givenName; + // } - public static function fromArray($member) - { - $id = $member['id']; - $familyName = $member['familyName']; - $givenName = $member['givenName']; - return new User($id, $familyName, $givenName); - } + // public static function fromArray($member) + // { + // $id = $member['id']; + // $familyName = $member['familyName']; + // $givenName = $member['givenName']; + // return new User($id, $familyName, $givenName); + // } - public static function getUsers($db, $options = []) - { - $attributeId = $options['attributeId'] ?? null; - $params = []; - $query = 'SELECT ' . - '`cwsvjudo`.`wkParticipo_Users`.`id` AS `id`' . - ', `cwsvjudo`.`wkParticipo_Users`.`vorname` AS `givenName`' . - ', `cwsvjudo`.`wkParticipo_Users`.`name` AS `familyName`' . - ', `cwsvjudo`.`wkParticipo_userAttributes`.`name` AS `attributeName`' . - 'FROM `cwsvjudo`.`wkParticipo_Users` ' . - 'JOIN `cwsvjudo`.`wkParticipo_user<=>userAttributes` ' . - 'ON `cwsvjudo`.`wkParticipo_Users`.`id` = `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`userId`' . - 'JOIN `cwsvjudo`.`wkParticipo_userAttributes` ' . - 'ON `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`attributeId` = `cwsvjudo`.`wkParticipo_userAttributes`.`id`'; - if ($attributeId != null) { - $query .= ' WHERE `cwsvjudo`.`wkParticipo_userAttributes`.`id` = :attributeId'; - $params['attributeId'] = ['value' => $attributeId, 'data_type' => PDO::PARAM_INT]; - } - $query .= ';'; - $response = dbQuery($db, $query, $params); + // public static function getUsers($db, $options = []) + // { + // $attributeId = $options['attributeId'] ?? null; + // $params = []; + // $query = 'SELECT ' . + // '`cwsvjudo`.`wkParticipo_Users`.`id` AS `id`' . + // ', `cwsvjudo`.`wkParticipo_Users`.`vorname` AS `givenName`' . + // ', `cwsvjudo`.`wkParticipo_Users`.`name` AS `familyName`' . + // ', `cwsvjudo`.`wkParticipo_userAttributes`.`name` AS `attributeName`' . + // 'FROM `cwsvjudo`.`wkParticipo_Users` ' . + // 'JOIN `cwsvjudo`.`wkParticipo_user<=>userAttributes` ' . + // 'ON `cwsvjudo`.`wkParticipo_Users`.`id` = `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`userId`' . + // 'JOIN `cwsvjudo`.`wkParticipo_userAttributes` ' . + // 'ON `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`attributeId` = `cwsvjudo`.`wkParticipo_userAttributes`.`id`'; + // if ($attributeId != null) { + // $query .= ' WHERE `cwsvjudo`.`wkParticipo_userAttributes`.`id` = :attributeId'; + // $params['attributeId'] = ['value' => $attributeId, 'data_type' => PDO::PARAM_INT]; + // } + // $query .= ';'; + // $response = dbQuery($db, $query, $params); - $users = []; - foreach ($response as $r) { - $users[] = User::fromArray($r); - } - return $users; - } + // $users = []; + // foreach ($response as $r) { + // $users[] = User::fromDbArray($r); + // } + // return $users; + // } - public static function htmlTable($users) - { - echo(''); - foreach ($users as $u) { - echo(''); - } - echo('
IdNameVorname
' . $u->id . '' . $u->familyName . '' . $u->givenName . '
'); - } - } + // public static function htmlTable($users) + // { + // echo(''); + // foreach ($users as $u) { + // echo(''); + // } + // echo('
IdNameVorname
' . $u->id . '' . $u->familyName . '' . $u->givenName . '
'); + // } + // } /** * Datastructure and interface for attendances @@ -264,9 +264,11 @@ setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
- +