80 lines
2.3 KiB
PHP
80 lines
2.3 KiB
PHP
<?php
|
|
require_once('machs.php');
|
|
|
|
PHPCount::AddHit("Achievementbuilder (".htmlspecialchars($_SESSION['user']['username']).")");
|
|
|
|
$dbConnection = getPdoDbConnection(
|
|
$cwsvJudoConfig["db"]["host"],
|
|
$cwsvJudoConfig["db"]["name"],
|
|
$cwsvJudoConfig["db"]["user"],
|
|
$cwsvJudoConfig["db"]["password"]
|
|
);
|
|
|
|
if(!isUserAdmin($dbConnection, $_SESSION['user']['userId']))
|
|
header("Location: .");
|
|
|
|
record::setDbConnection($dbConnection);
|
|
achievementGroup::setDbConnection($dbConnection);
|
|
$achievementGroups = achievementGroup::getAllAchievementGroups();
|
|
|
|
processPostData($dbConnection, $_POST);
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
<!-- Compiled and minified CSS -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
|
|
<!-- Compiled and minified JavaScript -->
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
|
<!-- inits for the materializeCss -->
|
|
<?php include("lib/machs/materializeInit.php");?>
|
|
|
|
<title>machs</title>
|
|
<meta name="description" content="Achievementsystem der Judoka des Chemnitzer WSV">
|
|
|
|
<link rel="icon" href="<?echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" />
|
|
<link rel="apple-touch-icon" href="<?echo($config['baseUrl']);?>/apple-touch-icon.png">
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<!-- sidenav -->
|
|
<?php include("lib/machs/sidenav.php");?>
|
|
<!-- end sidenav -->
|
|
<h1>AchievementBuilder</h1>
|
|
<?php
|
|
echo("<h2 id=\"addAchievementGroup\">Add AchievementGroup</h2>");
|
|
echo(achievementGroup::htmlAddAchievementGroupForm());
|
|
|
|
echo("<h2>Update Achievements</h2>");
|
|
foreach($achievementGroups as $g){
|
|
echo("<h3>".$g->getName()."</h3>");
|
|
echo($g->htmlEditAchievementGroupForm());
|
|
|
|
$achievements = $g->getAchievements();
|
|
if(empty($achievements)){
|
|
echo("<h4>Auto Add Achievements</h4>".achievementGroup::htmlAutoAddAchievementsForm($g->getId()));
|
|
}
|
|
foreach($achievements as $a){
|
|
echo("<h4>".$a['name']."</h4>");
|
|
echo(htmlUpdateAchievementBox(
|
|
$a['id'],
|
|
$a['name'],
|
|
$a['rootId'],
|
|
$a['achievementGroupId'],
|
|
$a['level'],
|
|
$a['description'],
|
|
$a['imgUrl']
|
|
));
|
|
}
|
|
echo("<h4>Add achievement</h4>");
|
|
echo(htmlAddAchievementBox());
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|
|
|