diff --git a/homepage/participo/attendence.php b/homepage/participo/attendence.php new file mode 100644 index 0000000..def6ef2 --- /dev/null +++ b/homepage/participo/attendence.php @@ -0,0 +1,242 @@ += CURDATE() ". + "ORDER BY wkParticipo_Events.date;"; + $ret = dbQuery($dbConn, $query); + // $results = $anMysqlConn->query($query); + + // // Bei einem Fehler bei der Abfrage soll NULL zurückgeliefert werden + // if( !$results ){ + // echo("No Results: ".$anMysqlConn->error); + // return NULL; + // } + // // Bei einem leeren Ergebnis (NULL oder leeres Array) soll ein leeres Array zurückgeliefert werden + // if( empty($results) ) return array(); + + // while( $result = $results->fetch_assoc() ){ + // array_walk( + // $result, + // function (&$value, $key, $someOptions) { + // $value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value); + // }, + // $someOptions + // ); + // array_push( $ret, $result); + // } + return $ret; +} + +// array(12) { +// ["id"]=> string(3) "139" +// ["date"]=> string(10) "2021-12-29" +// ["wkId"]=> string(0) "" +// ["meldefrist"]=> string(10) "2021-12-28" +// ["bemerkungen"]=> string(374) "{ "Datum": "2021-12-29", "Veranstaltung": "Jahresabschlusstraining", "Altersklassen": "alle", "bemerkungen": " + +// Zum Abschluss des Jahres noch einmal eine kleine Einheit hauptsächlich zum Spielen +// Zeit: 16:00--19:00 Uhr + +// ", "Ort": "unser Dojo, Str. Usti nad Labem 42, 09120 Chemnitz", "Routenplaner": "https://osm.org/go/0MIYhLf3Q-" }" +// ["kvOptions"]=> string(0) "" +// ["Datum"]=> string(0) "" +// ["Veranstaltung"]=> string(0) "" +// ["Altersklassen"]=> string(0) "" +// ["Ort"]=> string(0) "" +// ["Ausschreibung"]=> string(0) "" +// ["Routenplaner"]=> string(0) "" +// } +function getHtmlEventTable($eventList){ + $ret = ""; + foreach($eventList as $event){ + $e = json_decode($event['bemerkungen'], true); + $e = (($e==null)?$event:$e); + $e['id']=$event['id']; + $ret .= ""; + } + $ret .= "
".$e['Datum']."".$e['Veranstaltung']."
"; + return $ret; +} +?> + + + + + + + + + + + + participo + + + + + + + + +
+ + +
+ + +
+ +
+ "kyu", + 'title' => "Kyu", + 'description'=> "Die Prüfungsprogamme der einzelnen Gürtelstufen in Bild, Ton und Text", + 'imgUrl' => "images/obi.svg", + 'actions' => [ + AppCardAction::fromArray(['caption'=>"Kyu-Programme", 'link'=>"kyu"]), + ], + ])->htmlCode(). + AppCard::fromArray([ + 'link' => "/machs", + 'title' => "Mein Achievement System", + 'description'=> "Ein kleines Achievementsystem für die tägliche Herausforderung", + 'imgUrl' => "images/mountain-climber.svg", + 'actions' => [ + AppCardAction::fromArray(['caption'=>"MAchS", 'link'=>"/machs"]), + ], + ])->htmlCode(). + AppCard::fromArray([ + 'link' => "/pages/desktop/wkParticipo", + 'title' => "Event-Planer", + 'description'=> "Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.

".getHtmlEventTable(getCommingWkEvents($dbConnection))."

", + 'imgUrl' => "/ressourcen/graphiken/icons/terminKalender.svg", + 'actions' => [ + AppCardAction::fromArray(['caption'=>"Planer", 'link'=>"/pages/desktop/wkParticipo"]), + ], + ])->htmlCode(). + AppCard::fromArray([ + 'link' => "infoZettel", + 'title' => "Infozettel", + 'description'=> "Online-Variante der Infozettel und Newsletter", + 'imgUrl' => "images/info.svg", + 'actions' => [ + AppCardAction::fromArray(['caption'=>"Info", 'link'=>"infoZettel"]), + ], + ])->htmlCode() +); +?> +

+ +
+ + +
+ "user", + 'title' => "User-Config", + 'description' => "Einstellungen zum aktuellen Benutzer dessen Kindern", + 'imgUrl' => "images/account.svg", + 'actions' => [ + AppCardAction::fromArray(['caption'=>"Config", 'link'=>"user"]), + ], + ])->htmlCode() +); +// AdminStuff, thats only visible for Admins +if( isUserAdmin($dbConnection, $userData['id']) ){ + echo( + AppCard::fromArray([ + 'title' =>"lastLogins", + 'description' => "

".lastLoginTable()."

" + ])->htmlCode() + ); +} +?> +
+
+ + + diff --git a/homepage/participo/index.php b/homepage/participo/index.php index db9f924..def6ef2 100644 --- a/homepage/participo/index.php +++ b/homepage/participo/index.php @@ -112,16 +112,7 @@ function getHtmlEventTable($eventList){ - - - - - - - - - - + - - - - - + diff --git a/homepage/participo/kyu.php b/homepage/participo/kyu.php index b04847f..c70576e 100644 --- a/homepage/participo/kyu.php +++ b/homepage/participo/kyu.php @@ -138,12 +138,8 @@ function ytLightEmbed($item){ Gürtelprüfungsordnung - - - - - - + + diff --git a/homepage/participo/lib/planerLib/planer.php b/homepage/participo/lib/planerLib/planer.php new file mode 100644 index 0000000..2e5422f --- /dev/null +++ b/homepage/participo/lib/planerLib/planer.php @@ -0,0 +1,64 @@ +$db = $db; + } +} + +class shiai{ + private $id = null; //< unique id + private $date = null; //< date of the shiai + private $name = null; //< name of the shiai as string + private $ageclasses = null; //< age classes as space separated Uxy in a string + private $place = null; //< place of the shiai as string + private $announcementUrl = null; //< url to the announcement + private $routeUrl = null; //< url to a routing planner + private $galleryUrl = null; //< url of the gallery to a gallery of the shiai + private $promoImgUrl = null; //< promotional image for the shiai (as url) + + function __construct($id, $date, $name, $ageclasses, $place, $announcementUrl, $routeUrl, $galleryUrl, $promoImgUrl){ + //! @todo input validation and sanitation + $this->$id = (int) $id; + $this->$date = DateTime::createFromFormat("Y-m-d", $date); + $this->$name = $name; + $this->ageclasses = $ageclasses; + $this->place = $place; + $this->announcementUrl = $announcementUrl; + $this->routeUrl = $routeUrl; + $this->galleryUrl = $galleryUrl; + $this->promoImgUrl = $promoImgUrl; + } + static public function fromArray($member){ + $id = $member['lfdeNr'] ?? null; + $date = $member['Datum'] ?? null; + $name = $member['Veranstaltung'] ?? ""; + $ageclasses = $member['Altersklassen'] ?? null; + $place = $member['Ort'] ?? ""; + $announcementUrl = $member['Ausschreibung'] ?? null; + $routeUrl = $member['Routenplaner'] ?? null; + $galleryUrl = $member['galleryLink'] ?? null; + $promoImgUrl = $member['promoPic'] ?? null; + } +} +class event{ + private $id = null; //< unique id of the event in the db + private $date = null; //< date for the event (@todo ranges?) + private $shiaiId = null; //< unique id of the shiai in the db (if appropriate) + private $deadline = null; //< until when one can register for the event + private $remarks = null; //< remarks to the event (special rules) or a json object for missing data (e.g. non-shiai events) + + private $shiai = null; + + function __construct($id, $date, $shiaiId, $deadline, $remarks){ + //! @todo InputValidation + $this->$id = (int) $id; + $this->$date = DateTime::createFromFormat("Y-m-d", $date); + $this->shiaiId = (($shiaiId!=null)?((int)$shiaiId):(null)); + $this->deadline = DateTime::createFromFormat("Y-m-d"); + $this->remarks = $remarks; + } +} + +?> \ No newline at end of file diff --git a/homepage/participo/login.php b/homepage/participo/login.php index aae2fb5..8a15930 100644 --- a/homepage/participo/login.php +++ b/homepage/participo/login.php @@ -102,7 +102,7 @@ else{ - Login des Achievementsystemes der Judoka des Chemnitzer WSV + cwsvJudo Online Apps diff --git a/homepage/participo/shared/imports.php b/homepage/participo/shared/imports.php index 0243b8c..e305237 100644 --- a/homepage/participo/shared/imports.php +++ b/homepage/participo/shared/imports.php @@ -1,8 +1,10 @@ - + + + diff --git a/homepage/participo/user.php b/homepage/participo/user.php index 2289dd6..4ccad3b 100644 --- a/homepage/participo/user.php +++ b/homepage/participo/user.php @@ -32,9 +32,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); - +