229 lines
6.9 KiB
PHP
229 lines
6.9 KiB
PHP
<?php
|
|
require_once 'config/participo.php';
|
|
|
|
require_once './local/cwsvJudo.php';
|
|
|
|
require_once './lib/db.php'; // should be replaced
|
|
require_once './lib/api.php'; // should be replaced
|
|
|
|
require_once 'participoLib/participo.php';
|
|
require_once 'participoLib/planer.php';
|
|
require_once 'participoLib/apiKey.php';
|
|
require_once 'config/phpcount.config.php';
|
|
require_once 'phpcount/phpcount.php';
|
|
|
|
PHPCount::AddHit('participo');
|
|
|
|
dbConnector::connect(
|
|
$cwsvJudoConfig['db']['host'],
|
|
$cwsvJudoConfig['db']['name'],
|
|
$cwsvJudoConfig['db']['user'],
|
|
$cwsvJudoConfig['db']['password']
|
|
);
|
|
|
|
participo::authentificate();
|
|
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
<?php readfile('./shared/imports.php'); ?>
|
|
|
|
<!-- inits for the materializeCss -->
|
|
<script>
|
|
// What to do when the document is loaded.
|
|
document . addEventListener('DOMContentLoaded', function () {
|
|
// init materialize elements
|
|
initModals();
|
|
initSidenav();
|
|
});
|
|
|
|
function initSidenav() {
|
|
var sidenavElements = document.querySelectorAll('.sidenav');
|
|
// var sidenavInstances =
|
|
M.Sidenav.init(sidenavElements, {
|
|
});
|
|
};
|
|
// Init Modals
|
|
function initModals() {
|
|
var modalElements = document.querySelectorAll('.modal');
|
|
// var modalInstances =
|
|
M.Modal.init(modalElements, {
|
|
'onOpenEnd': initSelects
|
|
});
|
|
};
|
|
// Init select forms
|
|
function initSelects() {
|
|
var selectElements = document.querySelectorAll('select');
|
|
// var selectInstances =
|
|
M.FormSelect.init(selectElements, {});
|
|
}
|
|
</script>
|
|
|
|
<style>h1{ font-size: 2.00rem;}h2{ font-size: 1.50rem;}h3{ font-size: 1.25rem;}h3{ font-size: 1.20rem;}h3{ font-size: 1.15rem;}h6{ font-size: 1.10rem;}</style>
|
|
|
|
<title>participo</title>
|
|
<meta name="description" content="Online-Apps 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>
|
|
<header>
|
|
<nav class="indigo darken-4">
|
|
<h1 style="display:inline;">cwsvJudo Apps</h1>
|
|
<a class="right top-nav sidenav-trigger waves-effect waves-light hide-on-large-only" href="#" data-target="nav-mobile">
|
|
<i class="material-icons">menu</i>
|
|
</a>
|
|
</nav>
|
|
<ul class="sidenav sidenav-fixed sidenav-close" id="nav-mobile">
|
|
<li class="logo">
|
|
<a style="height:auto;" class="brand-logo" id="logo-container" href="/participo/">
|
|
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
|
</a>
|
|
</li>
|
|
<?php require_once 'sidenav/loginStatus.php'; ?><!-- brings its own li -->
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal right-align" href="#mitmachApps">Mitmachen<i class="material-icons">accessibility</i></a>
|
|
</li>
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal right-align" href="#infoApps">Informieren<i class="material-icons">info</i></a>
|
|
</li>
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal right-align" href="#lexiApps">Nachschlagen<i class="material-icons">book</i></a>
|
|
</li>
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal right-align" href="#configApps">Einstellen<i class="material-icons">settings</i></a>
|
|
</li>
|
|
<?php if (participo::isUserAdmin($userData['id'])) {?>
|
|
<li class="bold">
|
|
<a class="waves-effect waves-teal right-align" href="#admiStuff">adminStuff</a>
|
|
</li>
|
|
<?php }?>
|
|
</ul>
|
|
</header>
|
|
|
|
<?php
|
|
if ($_SESSION['login']) {
|
|
?>
|
|
<main>
|
|
<!-- List of Mitmach-Apps -->
|
|
<h2>Zum Mitmachen</h2>
|
|
<div class="row" id="mitmachApps">
|
|
<?php
|
|
echo(
|
|
AppCard::fromArray([
|
|
'link' => '/machs',
|
|
'title' => '<em>M</em>ein <em>Ach</em>ievement <em>S</em>ystem',
|
|
'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' => 'events',
|
|
'title' => 'Event-Planer',
|
|
'description' => 'Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.' . eventPlaner::getHtmlEventTable(eventPlaner::getComingWkEvents()),
|
|
'imgUrl' => '/ressourcen/graphiken/icons/terminKalender.svg',
|
|
'actions' => [
|
|
AppCardAction::fromArray(['caption' => 'Planer', 'link' => 'events']),
|
|
],
|
|
])->htmlCode()
|
|
)
|
|
?>
|
|
</div> <!-- mitmachApps -->
|
|
|
|
<h2>Zur Information</h2>
|
|
<div class="row" id="infoApps">
|
|
<?php
|
|
echo(
|
|
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() .
|
|
AppCard::fromArray([
|
|
'link' => 'attendance',
|
|
'title' => 'Teilnahme',
|
|
'description' => 'Eine kleine Übersicht, wie wie oft man beim Training war',
|
|
'imgUrl' => 'http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/calendarIcon.svg',
|
|
'actions' => [
|
|
AppCardAction::fromArray(['caption' => 'Anwesenheit', 'link' => 'attendance']),
|
|
],
|
|
])->htmlCode()
|
|
);
|
|
// @todo attendanceApp?>
|
|
</div> <!-- infoApps -->
|
|
|
|
<h2>Zum Nachschlagen</h2>
|
|
<div class="row" id="lexiApps">
|
|
<?php
|
|
echo(
|
|
AppCard::fromArray([
|
|
'link' => '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' => '/JudoWiki',
|
|
'title' => 'JudoWiki',
|
|
'description' => 'Ein Wiki zum Thema Judo',
|
|
'imgUrl' => 'http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/wikipediaW.svg',
|
|
'actions' => [
|
|
AppCardAction::fromArray(['caption' => 'JudoWiki', 'link' => '/JudoWiki']),
|
|
],
|
|
])->htmlCode()
|
|
);
|
|
// @todo horstWolf?>
|
|
</div><!-- lexiApps -->
|
|
|
|
<!-- List of ConfigStuff -->
|
|
<h2>Zum Einstellen</h2>
|
|
<div class="row" id="configApps">
|
|
<?php
|
|
echo(
|
|
AppCard::fromArray([
|
|
'link' => 'user',
|
|
'title' => 'User-Config',
|
|
'description' => 'Einstellungen zum aktuellen Benutzer dessen Kindern',
|
|
'imgUrl' => 'images/account.svg',
|
|
'actions' => [
|
|
AppCardAction::fromArray(['caption' => 'Config', 'link' => 'user']),
|
|
],
|
|
])->htmlCode()
|
|
); ?>
|
|
</div> <!-- configApps -->
|
|
<?php
|
|
// AdminStuff, thats only visible for Admins
|
|
if (participo::isUserAdmin($userData['id'])) {
|
|
echo(
|
|
'<h2>AdminStuff</h2>' .
|
|
'<div id="admiStuff" class="row">' .
|
|
AppCard::fromArray([
|
|
'title' => 'lastLogins',
|
|
'description' => '</p>' . lastLoginTable() . '</p>'
|
|
])->htmlCode() .
|
|
'</div>'
|
|
);
|
|
} ?>
|
|
</main>
|
|
<?php
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|