Merge branch 'master' into sportabzeichen
This commit is contained in:
@@ -8,14 +8,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
require_once("./lib/db.php");
|
||||
require_once("./lib/achievementsLib.php");
|
||||
require_once("./lib/api.php");
|
||||
|
||||
$dbConnection = getPdoDbConnection(
|
||||
$cwsvJudoConfig["db"]["host"],
|
||||
$cwsvJudoConfig["db"]["name"],
|
||||
$cwsvJudoConfig["db"]["user"],
|
||||
$cwsvJudoConfig["db"]["password"]
|
||||
);
|
||||
require_once("./auth.php");
|
||||
require_once("./lib/machs/achievementGroup.php");
|
||||
|
||||
$basePath = "/users/cwsvjudo/www";
|
||||
require_once($basePath."/config/cwsvJudo.config.php");
|
||||
@@ -27,7 +20,6 @@ $dbConnection = getPdoDbConnection(
|
||||
$cwsvJudoConfig["db"]["user"],
|
||||
$cwsvJudoConfig["db"]["password"]
|
||||
);
|
||||
|
||||
require_once("./auth.php");
|
||||
|
||||
achievementGroup::setDbConnection($dbConnection);
|
||||
@@ -44,10 +36,14 @@ processPostData($dbConnection, $_POST);
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<!-- unpkg : use the latest version of Video.js -->
|
||||
<link href="https://unpkg.com/video.js/dist/video-js.min.css" rel="stylesheet">
|
||||
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
|
||||
|
||||
<!-- Compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/css/materialize.min.css">
|
||||
<!-- Compiled and minified JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/js/materialize.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/css/materialize.min.css">
|
||||
<!-- Compiled and minified JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/js/materialize.min.js"></script>
|
||||
|
||||
<!-- inits for the materializeCss -->
|
||||
<?php include("lib/machs/materializeInit.php");?>
|
||||
@@ -61,34 +57,51 @@ processPostData($dbConnection, $_POST);
|
||||
</head>
|
||||
<body>
|
||||
<?php include("lib/machs/sidenav.php");?>
|
||||
|
||||
<?php // Für die 12-Nächte-Challenge
|
||||
$now = new DateTime();
|
||||
$promoStart = new DateTime("2021-11-24");
|
||||
$promoEnd = new DateTime("2022-02-06");
|
||||
$from = new DateTime("2021-12-24");
|
||||
|
||||
if($promoStart <= $now && $now <= $promoEnd) {
|
||||
echo("<h1 style=\"font-size:1.5rem;\">12-Nächte-Challenge</h1>");
|
||||
if($now < $from) echo("<p>Die 12-Nächte-Challenge geht vom 24.12.2021--06.01.2022. Ziel ist es möglichts an allen Tagen ein Achievement zu erhalten. Sobald es losgeht, wird hier die aktuelle Rangliste stehen.");
|
||||
record::setDbConnection($dbConnection);
|
||||
$zwölfer = record::getTopAchievers(array('from'=>"2021-12-24", 'to'=>"2022-01-06"));
|
||||
echo("<table>");
|
||||
record::setDbConnection($dbConnection);
|
||||
foreach( record::getTopAchievers(array('from'=>"2021-12-24", 'to'=>"2022-01-06")) as $t ){
|
||||
echo("<tr><td>".$t['vorname']."</td><td>".$t['name']."</td><td>".$t['COUNT(*)']."</td></tr>");
|
||||
}
|
||||
echo("</table>");
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if( hasUserAttribute($dbConnection, $_SESSION['user']['userId'], "inTraining" ) ){
|
||||
echo( "<h2>Eigene Achievements</h2>" );
|
||||
echo( htmlUsersUploadBox($dbConnection, $_SESSION['user']['userId']) );
|
||||
echo(htmlAchievementListForUser(
|
||||
$dbConnection,
|
||||
$achievementGroups,
|
||||
$_SESSION['user']['userId'],
|
||||
getUsersAchievements($dbConnection, $_SESSION['user']['userId'])
|
||||
));
|
||||
echo( "<div style=\"display:flex; flex-wrap:wrap; align-items:stretch;\" class=\"row\">");
|
||||
foreach($achievementGroups as $g){
|
||||
echo($g->asHtmlCard($_SESSION['user']['userId']));
|
||||
}
|
||||
echo("</div>" );
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<?php
|
||||
$usersKids = getUsersKids($dbConnection, $_SESSION['user']['userId']);
|
||||
foreach($usersKids as $k){
|
||||
if( hasUserAttribute($dbConnection, $k['kidId'], "inTraining" ) and ($k['kidId']!=$_SESSION['user']['userId']) ){
|
||||
echo( "<h2>".$k['vorname']." ".$k['name']."</h2>" );
|
||||
echo( htmlUsersUploadBox($dbConnection, $k['kidId']) );
|
||||
echo(htmlAchievementListForUser(
|
||||
$dbConnection,
|
||||
$achievementGroups,
|
||||
$k['id'],
|
||||
getUsersAchievements($dbConnection, $k['id'])
|
||||
));
|
||||
<?php // show the achievements of each kid
|
||||
$usersKids = getUsersKids($dbConnection, $_SESSION['user']['userId']);
|
||||
foreach($usersKids as $k){
|
||||
if( hasUserAttribute($dbConnection, $k['kidId'], "inTraining" ) ){
|
||||
echo( "<h2>".$k['vorname']." ".$k['name']."</h2>" );
|
||||
echo( "<div style=\"display:flex; flex-wrap:wrap; align-items:stretch;\" class=\"row\">");
|
||||
foreach($achievementGroups as $g){
|
||||
echo($g->asHtmlCard($k['kidId'], ['noForm'=>false]));
|
||||
}
|
||||
}
|
||||
?>
|
||||
echo("</div>" );
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if(isUserAdmin($dbConnection, $_SESSION['user']['userId'])){
|
||||
@@ -101,9 +114,11 @@ processPostData($dbConnection, $_POST);
|
||||
echo( htmlUpdateAchievementBox(
|
||||
$a['id'],
|
||||
$a['name'],
|
||||
$a['description'],
|
||||
$a['rootId'],
|
||||
$a['level']
|
||||
$a['achievementGroupId'],
|
||||
$a['level'],
|
||||
$a['description'],
|
||||
$a['imgUrl']
|
||||
));
|
||||
echo("<hr />");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user