diff --git a/.gitmodules b/.gitmodules index e3b0280..cec3a12 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ +[submodule "homepage/materialize"] + path = submodules/materialize + url = https://github.com/materializecss/materialize.git +[submodule "homepage/redesign2018/markdownExperiment/zopfli"] + path = submodules/zopfli + url = https://github.com/google/zopfli.git [submodule "submodules/parsedown"] path = submodules/parsedown url = https://github.com/erusev/parsedown diff --git a/coronaZeit/mdNewsletter.d/2021-09-26.md b/coronaZeit/mdNewsletter.d/2021-09-26.md new file mode 100644 index 0000000..476539f --- /dev/null +++ b/coronaZeit/mdNewsletter.d/2021-09-26.md @@ -0,0 +1,27 @@ +--- +title: Newsletter 2021-09-26 +--- + +# Neue Trainingszeiten und Herbstkrümelrandori + +Hallo liebe Eltern, +hallo liebe Judoka! + +## Neue Trainingszeiten + +Da in letzter Zeit erfreulich viele Anfänger zu uns gestoßen sind, können wir unsere Traningszeiten am Freitag wieder auftrennen: + +- Freitag (Kinder/Anfänger) + - 16:00–17:45 Uhr + - Zielgruppe: Anfänger und Kinder unter 9 Jahren +- Freitag (Jugend/Fortgeschrittene) + - 17:30–19:00 Uhr + - Zielgruppe: Wer die Grundlagen des Judo beherrscht + +## Herbstkrümelrandori + +Noch nicht offiziell angekündigt, aber nach Interese gefragt wurde für das Herbstkrümelrandori. Stattfinden soll es am Buß- und Bettag, dem 17. November für die Jahrgänge 2006-2010. + +## Wettkampfplaner + +Derzeit gibt es im Wettkampflaner offenbar Probleme beim Zustellen der Einschreibungs-Email. In mehreren Fällen habe ich trotz erfolgter Einschreibung keine Bestätigungsmail erhalten. Dadurch war ich teilweise nicht auf dem atuellen Stand der eingeschriebenen Starter. Sorry dafür. \ No newline at end of file diff --git a/coronaZeit/mdNewsletter.d/2021-10-30-schwimmen.md b/coronaZeit/mdNewsletter.d/2021-10-30-schwimmen.md new file mode 100644 index 0000000..93ac375 --- /dev/null +++ b/coronaZeit/mdNewsletter.d/2021-10-30-schwimmen.md @@ -0,0 +1,29 @@ +--- +title: Newsletter 2021-10-30 +--- + +Hallo liebe Eltern, +Hallo liebe Judoka! + +## Schwimmtraining + +Da einige von uns für das Sportabzeichen noch ihren Schwimmnachweis benötigten, waren einige von uns diese Woche in der Schwimmhalle. Dabei ist mir in Erinnerung gerufen worden, was für ein gutes Ergänzungstraining Schwimmen für den Judoka doch ist. Deshalb wollte ich ich eine zusätzliche Trainingseinheit in der Schwimmhalle vorschlagen. Zur besseren Terminfindung, habe ich mal eine [Umfrage gestartet][1]. Die bevorzugten Termine bitte mit grünem Haken, wo es grundsätzlich geht mit gelben Haken und wo es gar nicht geht mit rotem Kreuz markieren. + +Von der Terminfindung hängt dann auch die Schwimmhalle ab, da nicht alle [Schwimmhallen täglich geöffnet][2] sind. Mein persönlicher Favorit ist das [Stadtbad][3] wegen seiner 50 m Bahn. + +Da das Schwimmen als zusätzliches Training dienen soll und nicht als Badeausflug, sind gute Schwimmfähigkeiten eine zwingende Voraussetzung. + +## Trainingshilfen Kyu + +In unserem [Wiki][4] gibt es bereits [Übersichten][5] über das Kyu-Prüfungsprogramm. Seit kurzem gibt es eine [weitere Version][6] mit Videoerklärungen und für mobile Endgräte ausgelegt als Lernhilfe für die Judoka. Das ganze ist noch in laufender Entwicklung, die ersten paar Gürtel sind aber schon verfügbar. + +Mit sportlichen Grüßen + +marko + +[1]: https://framadate.org/1tyFG1lGd4bezLyg +[2]: https://chemnitz.de/chemnitz/de/leben-in-chemnitz/freizeit/hallenbaeder/index.html +[3]: https://chemnitz.de/chemnitz/de/leben-in-chemnitz/freizeit/hallenbaeder/stadtbad/index.html +[4]: http://cwsvjudo.bplaced.net/JudoWiki +[5]: http://cwsvjudo.bplaced.net/JudoWiki/Kyu/Kyu +[6]: http://cwsvjudo.bplaced.net/participo/kyu.php diff --git a/coronaZeit/coronaNewsletterReceiverEmails.txt b/coronaZeit/newsletterReceiverEmails.txt similarity index 80% rename from coronaZeit/coronaNewsletterReceiverEmails.txt rename to coronaZeit/newsletterReceiverEmails.txt index 75b15fc..d88dd5c 100644 --- a/coronaZeit/coronaNewsletterReceiverEmails.txt +++ b/coronaZeit/newsletterReceiverEmails.txt @@ -1,11 +1,16 @@ -churicnate@yahoo.com -alled82@gmx.de -j.felke@gmx.net akf21182@aol.com -norman.haeuberer@gmail.com -julia.haeuberer@gmx.de +alled82@gmx.de +churicnate@yahoo.com dani17184@web.de +j.felke@gmx.net +julia.haeuberer@gmx.de +mail@blankfuchs.de +manja.bunzel@gmx.de +meier.andrej@web.de mohamad.zahra1986@gmail.com +nick.weidensager@web.de +norman.haeuberer@gmail.com +oks.dietrich@gmail.com post@was7.de stephanie.brittnacher@gmail.com nick.weidensager@web.de diff --git a/homepage/machs/index.php b/homepage/machs/index.php index b78054c..f657d9c 100644 --- a/homepage/machs/index.php +++ b/homepage/machs/index.php @@ -1,7 +1,13 @@ @@ -38,34 +58,56 @@ processPostData($dbConnection, $_POST); - - - - - - + + Eigene Achievements" ); - echo( "
"); - foreach($achievementGroups as $g){ - echo($g->asHtmlCard($_SESSION['user']['userId'])); - } - echo("
" ); + echo( htmlUsersUploadBox($dbConnection, $_SESSION['user']['userId']) ); + echo(htmlAchievementListForUser( + $dbConnection, + $achievementGroups, + $_SESSION['user']['userId'], + getUsersAchievements($dbConnection, $_SESSION['user']['userId']) + )); } ?> - - ".$k['vorname']." ".$k['name']."" ); - echo( "
"); - foreach($achievementGroups as $g){ - echo($g->asHtmlCard($k['kidId'], ['noForm'=>false])); + + ".$k['vorname']." ".$k['name']."" ); + echo( htmlUsersUploadBox($dbConnection, $k['kidId']) ); + echo(htmlAchievementListForUser( + $dbConnection, + $achievementGroups, + $k['id'], + getUsersAchievements($dbConnection, $k['id']) + )); } - echo("
" ); } - } ?> - + +Add Achievements"); + echo(htmlAddAchievementBox()); + + echo("

Update Achievements

"); + $achievements = getAchievements($dbConnection); + foreach($achievements as $a){ + echo( htmlUpdateAchievementBox( + $a['id'], + $a['name'], + $a['description'], + $a['rootId'], + $a['level'] + )); + echo("
"); + } + } + ?> + + diff --git a/homepage/mams/index.php b/homepage/mams/index.php index b6c87d1..63bfa03 100644 --- a/homepage/mams/index.php +++ b/homepage/mams/index.php @@ -1,51 +1,50 @@
- - - - - - - -
+ + + + + + + + + + Corona-Anwesenheitsliste der Judoka des Chemnitzer WSV + -

Corona-Anwesenheitsliste der Judoka des Chemnitzer WSV

-

Anwesenheiten hinzufügen

+ + +

Anwesenheiten hinzufügen

+
@@ -56,7 +55,28 @@ $lastTrainingDay = max($dateLastWendsday, $dateLastFriday);
-

Anwesenheiten

+ +

Corona-Trainee hinzufügen

+ Added user."); + }else{ + echo("
ERROR
"); + } + } + ?> +
+ + + + + + + +
+ +

Anwesenheiten

Sende Anwesenheitsliste an eMail

@@ -86,15 +106,5 @@ $lastTrainingDay = max($dateLastWendsday, $dateLastFriday); echo(""); } ?> -

Trainee hinzufügen

- - - - - - - - -
diff --git a/homepage/mams/lib/api.php b/homepage/mams/lib/api.php index 3b54862..6cd3bdf 100644 --- a/homepage/mams/lib/api.php +++ b/homepage/mams/lib/api.php @@ -9,14 +9,31 @@ function processPostData($db, $post, $redirectLocation = "."){ updateCoronaData($db, $post['userId'], $post['columnName'], $post['columnValue']); } if($post['action'] == "addCoronaUser"){ - addCoronaUser( - $db, - $post['name'], - $post['vorname'], - $post['corona_PLZ'], - $post['corona_telephon'], - $post['corona_eMail'] - ); + if( + array_keys_exist( + $post, + ['name', 'vorname', 'corona_PLZ', 'corona_telephon', 'corona_eMail'] + ) + && isValid($post['corona_PLZ'], "plz") + && isValid($post['corona_telephon'], "phonenumber") + && isValid($post['corona_eMail'], "email") + // && isValid($post['name'], "name") + // && isValid($post['vorname'], "name") + ){ + addCoronaUser( + $db, + $post['name'], + $post['vorname'], + $post['corona_PLZ'], + $post['corona_telephon'], + $post['corona_eMail'] + ); + $redirectLocation .= "?addCoronaUserSuccess=true"; + } + else{ + $redirectLocation .= "?addCoronaUserSuccess=false"; + } + $redirectLocation .= "#addCoronaUser"; } if($post['action'] == "sendAttandeesPerEmail"){ sendEmail( @@ -78,4 +95,60 @@ function attendancesAssocArray2mdList($attendancesAssocArray, $date=null){ } return $ret; } + +/// Validaing a phone number +/// true if it validates, false if not +function validate_phone_number($phone) +{ + // Allow +, - and . in phone number + $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT); + // Remove "-" from number + $phone_to_check = str_replace("-", "", $filtered_phone_number); + // Check the lenght of number + // This can be customized if you want phone number from a specific country + if (strlen($phone_to_check) < 10 || strlen($phone_to_check) > 14) { + return false; + } else { + return true; + } +} + +/// validate different types of input +function isValid($toValidate, $type){ + // for now we disable the name validation: what do i know how people can be called! + // $regexName="/^[A-Z][a-zA-Z]*$/"; + $regexPlz ="/^[0-9]{5}$/"; + switch( $type ){ + case "plz": + return preg_match($regexPlz, $toValidate) > 0; + case "phonenumber": + return validate_phone_number($toValidate); + case "email": + return filter_var($toValidate, FILTER_VALIDATE_EMAIL); + default: + return false; + } + return false; +} + +//! Checks if multiple keys exist in an array +//! +//! @param array $array array to check for key +//! @param array|string $keys keys to check for +//! +//! @return bool true, if *all* keys are set in the array +function array_keys_exist( array $array, $keys ) { + if ( ! is_array( $keys ) ) { + $keys = func_get_args(); + array_shift( $keys ); + } + $count = 0; + foreach ( $keys as $key ) { + if ( isset( $array[$key] ) || array_key_exists( $key, $array ) ) { + $count++; + } + } + + return count( $keys ) === $count; +} ?> diff --git a/homepage/mams/lib/db.php b/homepage/mams/lib/db.php index 9200ae9..cee7aa9 100644 --- a/homepage/mams/lib/db.php +++ b/homepage/mams/lib/db.php @@ -57,8 +57,8 @@ if( empty($someOptions['dontFetch' ]) ) $someOptions['dontFetch' ] = false; $pdoResult = $pdoStatement->execute(); if(!$pdoResult){ echo("Error during dbQuery!\n"); - echo($aDbConnection->errorInfo(); - echo(PDOStatement::errorInfo(); + echo($aDbConnection->errorInfo()); + echo(PDOStatement::errorInfo()); } if($someOptions['dontFetch']){ $ret = NULL; @@ -83,9 +83,6 @@ if( empty($someOptions['dontFetch' ]) ) $someOptions['dontFetch' ] = false; ); } } -//var_dump($ret); -//var_dump($aQueryString); -//var_dump($aBindArray); return $ret; } diff --git a/homepage/mams/lib/mams/materializeInit.php b/homepage/mams/lib/mams/materializeInit.php new file mode 100644 index 0000000..62f5524 --- /dev/null +++ b/homepage/mams/lib/mams/materializeInit.php @@ -0,0 +1,11 @@ + diff --git a/homepage/mams/lib/mams/sidenav.php b/homepage/mams/lib/mams/sidenav.php new file mode 100644 index 0000000..6ca1209 --- /dev/null +++ b/homepage/mams/lib/mams/sidenav.php @@ -0,0 +1,6 @@ + +☰ mams diff --git a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php index e89e127..c902b11 100644 --- a/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php +++ b/homepage/redesign2018/markdownExperiment/phpLib/cwsvJudo/miscAssis.php @@ -7,8 +7,8 @@ return (is_numeric($str) && $str > 0 && $str == round($str)); function getPdoDbConnection($hostname, $dbName, $user, $password){ try{ $dbConnection = new PDO( - 'mysql:host='.$hostname.';dbname='.$dbName, - $user, + 'mysql:host='.$hostname.';dbname='.$dbName, + $user, $password ); } @@ -23,8 +23,8 @@ global $cwsvJudoConfig; // Datenbankverbindung bereit stellen try{ $db_connection = new PDO( - 'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8', - $cwsvJudoConfig["db"]["user"], + 'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],//.';charset=utf8', + $cwsvJudoConfig["db"]["user"], $cwsvJudoConfig["db"]["password"] ); } @@ -47,7 +47,7 @@ if (is_array($somePossibleEmptyStuff) || $somePossibleEmptyStuff instanceof Trav return null; } -/// Eine als String gegebene Liste kommagetrennter key=value Paare in +/// Eine als String gegebene Liste kommagetrennter key=value Paare in /// ein assoziatives Array überführen function getKeyValueArray($aKeyValueStringList){ $retKeyValueArray = array(); @@ -87,7 +87,7 @@ if( empty($optionsArray['outCharset']) ) $optionsArray['outCharset'] = "UTF-8"; ); $pdoStatementForQuerryingZitat->execute(); $retZitat = $pdoStatementForQuerryingZitat->fetchAll(PDO::FETCH_ASSOC); - + // Zeichensatzkonvertierung foreach($retZitat as &$entry){ array_walk( @@ -127,8 +127,8 @@ if( !file_exists($aJsonFileName) ) return null; if( !(is_array( $someLinkNames ) || is_object( $someLinkNames )) ) return null; return arrayKeyFilter( - json_decode( - file_get_contents($aJsonFileName), + json_decode( + file_get_contents($aJsonFileName), true ), $someLinkNames @@ -162,14 +162,14 @@ function toAscii($str, $replace=array(), $delimiter='-') { return $clean; } +/// Wrapper function for a query to the +/// $aDbConnection connection to a db function dbQuery($aDbConnection, $aQueryString, $aBindArray = array(), $someOptions = array( "dbCharset" => "ISO-8859-1", "outCharset" => "UTF-8" ) ){ -//echo("Doing ".$aQueryString); -var_dump($aBindArray); if( empty($someOptions['dbCharset']) ) $someOptions['dbCharset'] = "ISO-8859-1"; if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8"; -/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss -/// doch auch die Eingabe konvertiert werden. Aber das jetzt -/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B. +/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss +/// doch auch die Eingabe konvertiert werden. Aber das jetzt +/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B. /// als UTF8 in latin1(?) gespeichert. try{ $pdoStatement = $aDbConnection->prepare( $aQueryString ); @@ -187,7 +187,7 @@ if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8"; print "Error!: " . $db_error->getMessage() . "
"; return null; } - //var_dump($ret); + // Zeichensatzkonvertierung if( is_array($ret) ){ foreach($ret as &$entry){ diff --git a/homepage/wkParticipo/achievements.php b/homepage/wkParticipo/achievements.php new file mode 100644 index 0000000..6cb9a87 --- /dev/null +++ b/homepage/wkParticipo/achievements.php @@ -0,0 +1,46 @@ +userAttributes` (userId, attributeId) VALUES (:userId, :attributeId);", + "SELECT * FROM cwsvjudo.achievements;" + //array( + // ':userId' => array('value'=>$anUserId, 'data_type'=>PDO::PARAM_INT), + // ':attributeId'=> array('value'=>$anAttributeId, 'data_type'=>PDO::PARAM_INT) + //) + ); + } + catch(PDOException $db_error){ + print "Error!: " . $db_error->getMessage() . "
queryString: ".$queryString."
"; var_dump($bindArray); + } + + +// $query = "WITH SortedList (id, previousId, name, Level) AS ( SELECT Id, ParentId, SomeData, 0 as Level FROM cwsvjudo.achievements WHERE `id` IS 1 UNION ALL SELECT ll.id, ll.previousId, ll.name, Level+1 as Level FROM cwsvjudo.achievements ll INNER JOIN SortedList as s ON ll.previousId = s.Id ); SELECT id, previousId, name FROM SortedList ORDER BY Level "; +// $query = "SELECT (id, name, rootId, level) FROM cwsvjudo.achievements WHERE `id` = 1 ORDER BY `level`;"; +// $query = "SELECT * FROM cwsvjudo.achievements;"; +// $results = $mysqlConn->query($query); + +// var_dump($results); +?> + + + + + + diff --git a/homepage/wkParticipo/index.php b/homepage/wkParticipo/index.php index 7a6000e..2b3a7d0 100644 --- a/homepage/wkParticipo/index.php +++ b/homepage/wkParticipo/index.php @@ -18,6 +18,31 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); if ($mysqlConn->connect_error) { $sqlMessage['error'] .= 'Datenbankverbindung fehlgeschlagen: ' . $mysqlConn->connect_error; } +// var_dump($_SESSION); + +/// Stellt den cssCode mit den Variablendefinitionen bereit +/* +function colorThemeCss($colorArray = array('backgroundColor'=>"#FFAE00", 'highlightColor'=>"#FF8100", 'buttonColor'=>"#291670")){ +//$colorTypes = ["backgroundColor", "highlightColor", "buttonColor"]; +$defaultColors =['backgroundColor'=> "#FFAE00", 'highlightColor'=>"#FF8100", 'buttonColor'=>"#291670"]; + +//echo("DBG: colorArray:"); var_dump($colorArray); + +// Inputdatenvalidierung + foreach($defaultColors as $key=>$value){ + if( !preg_match("/^#(?:[0-9a-fA-F]{3}){1,2}$/", $colorArray[$key]) ){ + $colorArray[$key] = $defaultColors[$key]; + } + } + + $ret = ":root{"; + + foreach($colorArray as $key=>$value){ + $ret .= "--".$key.": ".$value."; "; + } + $ret .= "}"; +return $ret; +}*/ ?> @@ -47,6 +72,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');