Merge branch 'master' into infoZettel
This commit is contained in:
@@ -1,41 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||||
require_once("config/participo.php");
|
require_once 'config/participo.php';
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
|
||||||
require_once("./local/cwsvJudo.php");
|
|
||||||
|
|
||||||
require_once("./lib/db.php");
|
require_once './local/dbConf.php';
|
||||||
require_once("./lib/api.php");
|
require_once './local/cwsvJudo.php';
|
||||||
require_once("./lib/participoLib/participo.php");
|
|
||||||
|
|
||||||
require_once("./auth.php");
|
require_once './lib/db.php';
|
||||||
|
require_once './lib/api.php';
|
||||||
|
require_once './lib/participoLib/participo.php';
|
||||||
|
|
||||||
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
require_once $config['basePath'] . '/config/cwsvJudo.config.php';
|
||||||
require_once($config['basePath']."/config/phpcount.config.php");
|
require_once $config['basePath'] . '/config/phpcount.config.php';
|
||||||
|
|
||||||
dbConnector::connect(
|
dbConnector::connect(
|
||||||
$cwsvJudoConfig["db"]["host"],
|
$cwsvJudoConfig['db']['host'],
|
||||||
$cwsvJudoConfig["db"]["name"],
|
$cwsvJudoConfig['db']['name'],
|
||||||
$cwsvJudoConfig["db"]["user"],
|
$cwsvJudoConfig['db']['user'],
|
||||||
$cwsvJudoConfig["db"]["password"]
|
$cwsvJudoConfig['db']['password']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
participo::authentificate();
|
||||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
$usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
|
|
||||||
abstract class AttendanceType {
|
abstract class AttendanceType
|
||||||
|
{
|
||||||
const __default = null;
|
const __default = null;
|
||||||
|
|
||||||
const Training = 1;
|
const Training = 1;
|
||||||
const Excused = 2;
|
const Excused = 2;
|
||||||
const Ill = 3;
|
const Ill = 3;
|
||||||
const SpecialTraining = 4;
|
const SpecialTraining = 4;
|
||||||
const Competition = 5;
|
const Competition = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class UserAttribute {
|
abstract class UserAttribute
|
||||||
|
{
|
||||||
const __default = null;
|
const __default = null;
|
||||||
|
|
||||||
const IsAdmin = 1;
|
const IsAdmin = 1;
|
||||||
@@ -43,79 +44,86 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
const Passive = 3;
|
const Passive = 3;
|
||||||
const InTraining = 4;
|
const InTraining = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Datastructure and interface for an user
|
* Datastructure and interface for an user
|
||||||
*/
|
*/
|
||||||
class User{
|
class User
|
||||||
|
{
|
||||||
private $id = null;
|
private $id = null;
|
||||||
private $familyName = null;
|
private $familyName = null;
|
||||||
private $givenName = null;
|
private $givenName = null;
|
||||||
|
|
||||||
private $attributes = null;
|
private $attributes = null;
|
||||||
|
|
||||||
function __construct($id, $familyName, $givenName){
|
public function __construct($id, $familyName, $givenName)
|
||||||
|
{
|
||||||
$this->id = (int)$id;
|
$this->id = (int)$id;
|
||||||
$this->familyName = $familyName;
|
$this->familyName = $familyName;
|
||||||
$this->givenName = $givenName;
|
$this->givenName = $givenName;
|
||||||
}
|
}
|
||||||
static function fromArray($member){
|
|
||||||
|
public static function fromArray($member)
|
||||||
|
{
|
||||||
$id = $member['id'];
|
$id = $member['id'];
|
||||||
$familyName = $member['familyName'];
|
$familyName = $member['familyName'];
|
||||||
$givenName = $member['givenName'];
|
$givenName = $member['givenName'];
|
||||||
return new User($id, $familyName, $givenName);
|
return new User($id, $familyName, $givenName);
|
||||||
}
|
}
|
||||||
static function getUsers($db, $options = []){
|
|
||||||
$attributeId = $options["attributeId"] ?? null;
|
public static function getUsers($db, $options = [])
|
||||||
|
{
|
||||||
|
$attributeId = $options['attributeId'] ?? null;
|
||||||
$params = [];
|
$params = [];
|
||||||
$query = "SELECT ".
|
$query = 'SELECT ' .
|
||||||
"`cwsvjudo`.`wkParticipo_Users`.`id` AS `id`".
|
'`cwsvjudo`.`wkParticipo_Users`.`id` AS `id`' .
|
||||||
", `cwsvjudo`.`wkParticipo_Users`.`vorname` AS `givenName`".
|
', `cwsvjudo`.`wkParticipo_Users`.`vorname` AS `givenName`' .
|
||||||
", `cwsvjudo`.`wkParticipo_Users`.`name` AS `familyName`".
|
', `cwsvjudo`.`wkParticipo_Users`.`name` AS `familyName`' .
|
||||||
", `cwsvjudo`.`wkParticipo_userAttributes`.`name` AS `attributeName`".
|
', `cwsvjudo`.`wkParticipo_userAttributes`.`name` AS `attributeName`' .
|
||||||
"FROM `cwsvjudo`.`wkParticipo_Users` ".
|
'FROM `cwsvjudo`.`wkParticipo_Users` ' .
|
||||||
"JOIN `cwsvjudo`.`wkParticipo_user<=>userAttributes` ".
|
'JOIN `cwsvjudo`.`wkParticipo_user<=>userAttributes` ' .
|
||||||
"ON `cwsvjudo`.`wkParticipo_Users`.`id` = `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`userId`".
|
'ON `cwsvjudo`.`wkParticipo_Users`.`id` = `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`userId`' .
|
||||||
"JOIN `cwsvjudo`.`wkParticipo_userAttributes` ".
|
'JOIN `cwsvjudo`.`wkParticipo_userAttributes` ' .
|
||||||
"ON `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`attributeId` = `cwsvjudo`.`wkParticipo_userAttributes`.`id`";
|
'ON `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`attributeId` = `cwsvjudo`.`wkParticipo_userAttributes`.`id`';
|
||||||
if($attributeId != null){
|
if ($attributeId != null) {
|
||||||
$query .= " WHERE `cwsvjudo`.`wkParticipo_userAttributes`.`id` = :attributeId";
|
$query .= ' WHERE `cwsvjudo`.`wkParticipo_userAttributes`.`id` = :attributeId';
|
||||||
$params['attributeId'] = ['value'=>$attributeId, 'data_type'=>PDO::PARAM_INT];
|
$params['attributeId'] = ['value' => $attributeId, 'data_type' => PDO::PARAM_INT];
|
||||||
}
|
}
|
||||||
$query .= ";";
|
$query .= ';';
|
||||||
$response = dbQuery($db, $query, $params);
|
$response = dbQuery($db, $query, $params);
|
||||||
|
|
||||||
$users = [];
|
$users = [];
|
||||||
foreach( $response as $r){
|
foreach ($response as $r) {
|
||||||
$users[] = User::fromArray($r);
|
$users[] = User::fromArray($r);
|
||||||
}
|
}
|
||||||
return $users;
|
return $users;
|
||||||
}
|
}
|
||||||
static function htmlTable($users){
|
|
||||||
echo("<table><tr><th>Id<th>Name</th><th>Vorname</th></tr>");
|
public static function htmlTable($users)
|
||||||
foreach( $users as $u){
|
{
|
||||||
echo("<tr><td>".$u->id."</td><td>".$u->familyName."</td><td>".$u->givenName."</td></tr>");
|
echo('<table><tr><th>Id<th>Name</th><th>Vorname</th></tr>');
|
||||||
|
foreach ($users as $u) {
|
||||||
|
echo('<tr><td>' . $u->id . '</td><td>' . $u->familyName . '</td><td>' . $u->givenName . '</td></tr>');
|
||||||
}
|
}
|
||||||
echo("</table>");
|
echo('</table>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Datastructure and interface for attendances
|
* Datastructure and interface for attendances
|
||||||
*/
|
*/
|
||||||
class Attendance{
|
class Attendance
|
||||||
|
{
|
||||||
private $id = null; //< id in the db
|
private $id = null; //< id in the db
|
||||||
private $userId = null; //< user of the attendance
|
private $userId = null; //< user of the attendance
|
||||||
private $date = null; //< date of the attendance
|
private $date = null; //< date of the attendance
|
||||||
private $type = null; //< type of attendance
|
private $type = null; //< type of attendance
|
||||||
|
|
||||||
static private $Types = [
|
private static $Types = [
|
||||||
AttendanceType::Training => "Training"
|
AttendanceType::Training => 'Training', AttendanceType::Excused => 'Entschuldigt', AttendanceType::Ill => 'Krank', AttendanceType::SpecialTraining => 'SonderTraining', AttendanceType::Competition => 'Wettkampf'
|
||||||
, AttendanceType::Excused => "Entschuldigt"
|
|
||||||
, AttendanceType::Ill => "Krank"
|
|
||||||
, AttendanceType::SpecialTraining => "SonderTraining"
|
|
||||||
, AttendanceType::Competition => "Wettkampf"
|
|
||||||
];
|
];
|
||||||
static private $NameOfMonth = [1=>"Januar", 2=>"Februar", 3=>"März", 4=>"April", 4=>"Mai", 6=>"Juni", 7=>"Juli", 8=>"August", 9=>"September", 10=>"Oktober", 11=>"November", 12=>"Dezember"];
|
private static $NameOfMonth = [1 => 'Januar', 2 => 'Februar', 3 => 'März', 4 => 'April', 4 => 'Mai', 6 => 'Juni', 7 => 'Juli', 8 => 'August', 9 => 'September', 10 => 'Oktober', 11 => 'November', 12 => 'Dezember'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@@ -123,20 +131,24 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
* @param string/int $userId user of the attendance
|
* @param string/int $userId user of the attendance
|
||||||
* @param string $date date of the attendance
|
* @param string $date date of the attendance
|
||||||
*/
|
*/
|
||||||
function __construct($id, $userId, $date){
|
public function __construct($id, $userId, $date)
|
||||||
|
{
|
||||||
$this->id = (int)$id;
|
$this->id = (int)$id;
|
||||||
$this->userId = (int)$userId;
|
$this->userId = (int)$userId;
|
||||||
$this->date = DateTime::createFromFormat("Y-m-d", $date);
|
$this->date = DateTime::createFromFormat('Y-m-d', $date);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create an Attendance from an assoziative array
|
* create an Attendance from an assoziative array
|
||||||
*
|
*
|
||||||
* @param array $member
|
* @param array $member
|
||||||
* @return Attendance
|
* @return Attendance
|
||||||
*/
|
*/
|
||||||
static function constructFromArray($member){
|
public static function constructFromArray($member)
|
||||||
|
{
|
||||||
return new Attendance($member['id'], $member['userId'], $member['date']);
|
return new Attendance($member['id'], $member['userId'], $member['date']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* request a users attendances from the database
|
* request a users attendances from the database
|
||||||
*
|
*
|
||||||
@@ -144,16 +156,18 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
* @param int/string $userId
|
* @param int/string $userId
|
||||||
* @return array with attendances
|
* @return array with attendances
|
||||||
*/
|
*/
|
||||||
static function getUsersAttendance($db, $userId){
|
public static function getUsersAttendance($db, $userId)
|
||||||
|
{
|
||||||
$userId = (int)$userId;
|
$userId = (int)$userId;
|
||||||
$query = "SELECT `id`, `date` FROM `cwsvjudo`.`anwesenheit` WHERE `userId` = :userId";
|
$query = 'SELECT `id`, `date` FROM `cwsvjudo`.`anwesenheit` WHERE `userId` = :userId';
|
||||||
$response = dbQuery($db, $query, [':userId'=>['value'=>$userId, 'data_type'=>PDO::PARAM_INT]]);
|
$response = dbQuery($db, $query, [':userId' => ['value' => $userId, 'data_type' => PDO::PARAM_INT]]);
|
||||||
$attendances = [];
|
$attendances = [];
|
||||||
foreach($response as $r){
|
foreach ($response as $r) {
|
||||||
$attendances[] = new Attendance($r['id'], $userId, $r['date']);
|
$attendances[] = new Attendance($r['id'], $userId, $r['date']);
|
||||||
}
|
}
|
||||||
return $attendances;
|
return $attendances;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* html table with users attendances
|
* html table with users attendances
|
||||||
*
|
*
|
||||||
@@ -161,56 +175,61 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
* @param string/int $userId
|
* @param string/int $userId
|
||||||
* @return string with html code of the attendance table
|
* @return string with html code of the attendance table
|
||||||
*/
|
*/
|
||||||
static function userAttendanceHtmlTable($db, $userId){
|
public static function userAttendanceHtmlTable($db, $userId)
|
||||||
$htmlTableString = "";
|
{
|
||||||
$htmlTableString .= "<ul>";
|
$htmlTableString = '';
|
||||||
$userAttendances = Attendance::groupAttendances(
|
$htmlTableString .= '<ul>';
|
||||||
Attendance::getUsersAttendance($db, $userId)
|
$userAttendances = Attendance::groupAttendances(
|
||||||
|
Attendance::getUsersAttendance($db, $userId)
|
||||||
);
|
);
|
||||||
krsort($userAttendances);
|
krsort($userAttendances);
|
||||||
foreach( $userAttendances as $year=>$months ){
|
foreach ($userAttendances as $year => $months) {
|
||||||
$htmlTableString .= "<li>".$year."<dl>";
|
$htmlTableString .= '<li>' . $year . '<dl>';
|
||||||
// Counting the attendances per half year
|
// Counting the attendances per half year
|
||||||
$attendanceCountH1 = 0;
|
$attendanceCountH1 = 0;
|
||||||
$attendanceCountH2 = 0;
|
$attendanceCountH2 = 0;
|
||||||
foreach($months as $month=>$days){
|
foreach ($months as $month => $days) {
|
||||||
if(1<=$month and $month<=6){
|
if (1 <= $month and $month <= 6) {
|
||||||
$attendanceCountH1 += count($days);
|
$attendanceCountH1 += count($days);
|
||||||
}
|
}
|
||||||
if(7<=$month and $month <= 12){
|
if (7 <= $month and $month <= 12) {
|
||||||
$attendanceCountH2 += count($days);
|
$attendanceCountH2 += count($days);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$htmlTableString .= "<dt>Gesamt erstes Halbjahr:</dt><dd>".$attendanceCountH1."</dd>";
|
$htmlTableString .= '<dt>Gesamt erstes Halbjahr:</dt><dd>' . $attendanceCountH1 . '</dd>';
|
||||||
$htmlTableString .= "<dt>Gesamt zweites Halbjahr:</dt><dd>".$attendanceCountH2."</dd>";
|
$htmlTableString .= '<dt>Gesamt zweites Halbjahr:</dt><dd>' . $attendanceCountH2 . '</dd>';
|
||||||
krsort($months);
|
krsort($months);
|
||||||
foreach($months as $month=>$days){
|
foreach ($months as $month => $days) {
|
||||||
$htmlTableString .= "<dt>".Attendance::$NameOfMonth[$month]."</dt>";
|
$htmlTableString .= '<dt>' . Attendance::$NameOfMonth[$month] . '</dt>';
|
||||||
$htmlTableString .= "<dd>".join(", ", $days)."</dd>";
|
$htmlTableString .= '<dd>' . join(', ', $days) . '</dd>';
|
||||||
}
|
}
|
||||||
$htmlTableString .= "</dl></li>";
|
$htmlTableString .= '</dl></li>';
|
||||||
}
|
}
|
||||||
$htmlTableString .= "</ul>";
|
$htmlTableString .= '</ul>';
|
||||||
|
|
||||||
return $htmlTableString;
|
return $htmlTableString;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* group the attendances by year and month.
|
* group the attendances by year and month.
|
||||||
*
|
*
|
||||||
* @param list $attendances list of attendances
|
* @param list $attendances list of attendances
|
||||||
* @return array[int][int](list of int) array with a list of days for every month in every year
|
* @return array[int][int](list of int) array with a list of days for every month in every year
|
||||||
*/
|
*/
|
||||||
static function groupAttendances($attendances){
|
public static function groupAttendances($attendances)
|
||||||
|
{
|
||||||
$groupedAttendances = [];
|
$groupedAttendances = [];
|
||||||
foreach($attendances as $a){
|
foreach ($attendances as $a) {
|
||||||
$year =(int) $a->date->format("Y");
|
$year = (int) $a->date->format('Y');
|
||||||
if(!array_key_exists($year, $groupedAttendances))
|
if (!array_key_exists($year, $groupedAttendances)) {
|
||||||
$groupedAttendances[$year] = [];
|
$groupedAttendances[$year] = [];
|
||||||
$month = (int) $a->date->format("m");
|
}
|
||||||
if(!array_key_exists($month, $groupedAttendances[$year]))
|
$month = (int) $a->date->format('m');
|
||||||
|
if (!array_key_exists($month, $groupedAttendances[$year])) {
|
||||||
$groupedAttendances[$year][$month] = [];
|
$groupedAttendances[$year][$month] = [];
|
||||||
$day = (int) $a->date->format("d");
|
}
|
||||||
$groupedAttendances[$year][$month][]=$day;
|
$day = (int) $a->date->format('d');
|
||||||
|
$groupedAttendances[$year][$month][] = $day;
|
||||||
}
|
}
|
||||||
return $groupedAttendances;
|
return $groupedAttendances;
|
||||||
}
|
}
|
||||||
@@ -223,7 +242,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
<?php readfile("./shared/imports.php");?>
|
<?php readfile('./shared/imports.php'); ?>
|
||||||
|
|
||||||
<!-- inits for the materializeCss -->
|
<!-- inits for the materializeCss -->
|
||||||
<script>
|
<script>
|
||||||
@@ -254,50 +273,53 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php require_once("sidenav/loginStatus.php");?><!-- brings its own li -->
|
<?php require_once 'sidenav/loginStatus.php'; ?><!-- brings its own li -->
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal right-align" href="#attendance-<?php echo($userData['id']);?>">Selber</a>
|
<a class="waves-effect waves-teal right-align" href="#attendance-<?php echo($userData['id']); ?>">Selber</a>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
foreach($usersKids as $k){
|
foreach ($usersKids as $k) {
|
||||||
if($userData['id']==$k['id']) continue;
|
if ($userData['id'] == $k['id']) {
|
||||||
?>
|
continue;
|
||||||
|
} ?>
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal right-align" href="#attendance-<?php echo($k['kidId']); ?>"><?php echo($k['vorname']." ".$k['name']);?></a>
|
<a class="waves-effect waves-teal right-align" href="#attendance-<?php echo($k['kidId']); ?>"><?php echo($k['vorname'] . ' ' . $k['name']); ?></a>
|
||||||
</li>
|
</li>
|
||||||
<?php }?>
|
<?php
|
||||||
|
}?>
|
||||||
</ul>
|
</ul>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if($_SESSION['login']){
|
if ($_SESSION['login']) {
|
||||||
?>
|
?>
|
||||||
<main>
|
<main>
|
||||||
<?php //User::htmlTable( User::getUsers(dbConnector::getDbConnection(), ['attributeId' => UserAttribute::InTraining]));?>
|
<?php //User::htmlTable( User::getUsers(dbConnector::getDbConnection(), ['attributeId' => UserAttribute::InTraining]));?>
|
||||||
<?php // show own ...
|
<?php // show own ...
|
||||||
$ownAttendances = Attendance::getUsersAttendance(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$ownAttendances = Attendance::getUsersAttendance(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
if (!empty($ownAttendances)){
|
if (!empty($ownAttendances)) {
|
||||||
echo(
|
echo(
|
||||||
"<h2 id=\"attendance-".$userData['id']."\">Eigene Anwesenheiten</h2>".
|
'<h2 id="attendance-' . $userData['id'] . '">Eigene Anwesenheiten</h2>' .
|
||||||
Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $userData['id'])
|
Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $userData['id'])
|
||||||
); require_once("./lib/participoLib/participo.php");
|
);
|
||||||
|
require_once './lib/participoLib/participo.php';
|
||||||
|
}
|
||||||
|
// ... and kids attendances
|
||||||
|
if (!empty($usersKids)) {
|
||||||
|
echo('<h2>Anwesenheit der Kinder</h2>');
|
||||||
|
foreach ($usersKids as $k) {
|
||||||
|
if ($userData['id'] == $k['kidId']) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
// ... and kids attendances
|
echo(
|
||||||
if (!empty($usersKids)){
|
'<h3 id="attendance-' . $k['kidId'] . '">' . $k['vorname'] . ' ' . $k['name'] . '</h3>' .
|
||||||
echo("<h2>Anwesenheit der Kinder</h2>");
|
|
||||||
foreach($usersKids as $k){
|
|
||||||
if($userData['id']==$k['kidId']) continue;
|
|
||||||
echo(
|
|
||||||
"<h3 id=\"attendance-".$k['kidId']."\">".$k['vorname']." ".$k['name']."</h3>".
|
|
||||||
Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $k['kidId'])
|
Attendance::userAttendanceHtmlTable(dbConnector::getDbConnection(), $k['kidId'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</main>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
session_start();
|
|
||||||
// Falls der serverseitige LoginCookie nicht gesetzt ist,
|
|
||||||
// leite zur loginSeite weiter
|
|
||||||
if (empty($_SESSION['login'])) {
|
|
||||||
header("Location: login?returnTo=".urlencode($_SERVER['REQUEST_URI']), TRUE, 301);
|
|
||||||
exit;
|
|
||||||
} else {
|
|
||||||
$login_status =
|
|
||||||
"<div style=\"border: 1px solid black\">".
|
|
||||||
"Datum: ".date("Y-m-d")."<br />".
|
|
||||||
"Angemeldet als <strong>".htmlspecialchars($_SESSION['user']['username'])."</strong>.<br />".
|
|
||||||
"<a href=\"logout.php\">Sitzung beenden</a>".
|
|
||||||
"</div>";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -5,4 +5,8 @@ $config['basePath'] = "/users/cwsvjudo/www";
|
|||||||
$config['baseUrl'] = "http://cwsvjudo.bplaced.net";
|
$config['baseUrl'] = "http://cwsvjudo.bplaced.net";
|
||||||
$config['ressourceUrl'] = "http://cwsvjudo.bplaced.net/ressourcen";
|
$config['ressourceUrl'] = "http://cwsvjudo.bplaced.net/ressourcen";
|
||||||
|
|
||||||
|
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||||
|
set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
|
||||||
|
set_include_path(get_include_path() . PATH_SEPARATOR . $config['basePath']."/ressourcen/");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ require_once("participoLib/participo.php");
|
|||||||
require_once("participoLib/planer.php");
|
require_once("participoLib/planer.php");
|
||||||
|
|
||||||
require_once("config/participo.php");
|
require_once("config/participo.php");
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
require_once("./local/dbConf.php");
|
||||||
require_once("./local/cwsvJudo.php");
|
require_once("./local/cwsvJudo.php");
|
||||||
|
|
||||||
@@ -16,15 +16,15 @@ require_once("config/participo.php");
|
|||||||
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
||||||
|
|
||||||
dbConnector::connect(
|
dbConnector::connect(
|
||||||
$cwsvJudoConfig["db"]["host"],
|
$cwsvJudoConfig["db"]["host"],
|
||||||
$cwsvJudoConfig["db"]["name"],
|
$cwsvJudoConfig["db"]["name"],
|
||||||
$cwsvJudoConfig["db"]["user"],
|
$cwsvJudoConfig["db"]["user"],
|
||||||
$cwsvJudoConfig["db"]["password"]
|
$cwsvJudoConfig["db"]["password"]
|
||||||
);
|
);
|
||||||
eventPlaner::setDbConnection(dbConnector::getDbConnection());
|
eventPlaner::setDbConnection(dbConnector::getDbConnection());
|
||||||
|
|
||||||
participo::authentificate();
|
participo::authentificate();
|
||||||
|
|
||||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
|
|
||||||
$meta = array(
|
$meta = array(
|
||||||
|
|||||||
@@ -13,30 +13,45 @@ include_once("events.inc.php");
|
|||||||
|
|
||||||
<!-- inits for the materializeCss -->
|
<!-- inits for the materializeCss -->
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
function initSidenav() {
|
||||||
var elems = document.querySelectorAll('.sidenav');
|
var sidenavElements = document.querySelectorAll('.sidenav');
|
||||||
var instances = M.Sidenav.init(elems, {
|
var sidenavInstances = M.Sidenav.init(sidenavElements, {
|
||||||
// specify options here
|
|
||||||
});
|
});
|
||||||
});
|
};
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
function initModals() {
|
||||||
var elems = document.querySelectorAll('.modal');
|
var modalElements = document.querySelectorAll('.modal');
|
||||||
var instances = M.Modal.init(elems, {
|
var modalInstances = M.Modal.init(modalElements, {
|
||||||
// specify options here
|
|
||||||
});
|
});
|
||||||
});
|
};
|
||||||
|
function openEventModal(eventId){
|
||||||
|
openModal(`#event-modal-${eventId}`);
|
||||||
|
}
|
||||||
|
function openModal(modalId){
|
||||||
|
var modalElement = document.querySelector(modalId);
|
||||||
|
if( modalElement === null ){
|
||||||
|
console.log(`No modalElement by name ${modalId} found. Won't open!`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var modalInstance = M.Modal.getInstance(modalElement);
|
||||||
|
console.log("before opening: ", modalInstance);
|
||||||
|
modalInstance.open();
|
||||||
|
console.log("after opening: ", modalInstance);
|
||||||
|
}
|
||||||
|
|
||||||
// Open the given modal
|
// What to do when the document is loaded.
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// So far we assume the first given fragment (the stuff behind the #) is the modalId
|
// init materialize elements
|
||||||
var eventId = window.location.hash.substr(1);
|
initModals();
|
||||||
var Modalelem = document.querySelector('#event-modal-'+eventId);
|
initSidenav();
|
||||||
var instance = M.Modal.init(Modalelem);
|
|
||||||
instance.open();
|
// opening event modal if given
|
||||||
|
var eventId = parseInt( window.location.hash.substr(1) );
|
||||||
|
if( !isNaN(eventId) ){
|
||||||
|
openEventModal(eventId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<title><?php echo($meta['title']);?></title>
|
<title><?php echo($meta['title']);?></title>
|
||||||
<meta name="description" content="<?php echo($meta['description']);?>" />
|
<meta name="description" content="<?php echo($meta['description']);?>" />
|
||||||
|
|
||||||
@@ -47,37 +62,8 @@ include_once("events.inc.php");
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<!-- cwsvJudoApps SideNav -->
|
<!-- The sidenav -->
|
||||||
<div>
|
<?php require("./events.sidenav.inc.php");?>
|
||||||
<nav class="indigo darken-4">
|
|
||||||
<div class="nav-wrapper">
|
|
||||||
<div class="col s12">
|
|
||||||
<a href="http://cwsvjudo.bplaced.net/" class="breadcrumb">cwsvJudo-Apps</a>
|
|
||||||
<a href="http://cwsvjudo.bplaced.net/participo/events" class="breadcrumb"><?php echo($meta['title']);?></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<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="#eventList">Liste anstehender Events<i class="material-icons">format_list_bulleted</i></a>
|
|
||||||
</li>
|
|
||||||
<li class="bold">
|
|
||||||
<a class="waves-effect waves-teal right-align" href="#detailedEventList">Details anstehender Events<i class="material-icons">view_list</i></a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php if($_SESSION['login']){ ?>
|
<?php if($_SESSION['login']){ ?>
|
||||||
|
|||||||
31
homepage/participo/events.sidenav.inc.php
Normal file
31
homepage/participo/events.sidenav.inc.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<!-- cwsvJudoApps SideNav -->
|
||||||
|
<div>
|
||||||
|
<nav class="indigo darken-4">
|
||||||
|
<div class="nav-wrapper">
|
||||||
|
<div class="col s12">
|
||||||
|
<a href="http://cwsvjudo.bplaced.net/" class="breadcrumb">cwsvJudo-Apps</a>
|
||||||
|
<a href="http://cwsvjudo.bplaced.net/participo/events" class="breadcrumb"><?php echo($meta['title']);?></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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="#eventList">Liste anstehender Events<i class="material-icons">format_list_bulleted</i></a>
|
||||||
|
</li>
|
||||||
|
<li class="bold">
|
||||||
|
<a class="waves-effect waves-teal right-align" href="#detailedEventList">Details anstehender Events<i class="material-icons">view_list</i></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div><!-- cwsvJudoApps SideNav -->
|
||||||
@@ -1,29 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
require_once 'config/participo.php';
|
||||||
require_once("config/participo.php");
|
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
require_once './local/cwsvJudo.php';
|
||||||
require_once("./local/cwsvJudo.php");
|
|
||||||
|
|
||||||
require_once("./lib/db.php");
|
require_once './lib/db.php'; // should be replaced
|
||||||
require_once("./lib/api.php");
|
require_once './lib/api.php'; // should be replaced
|
||||||
require_once("./lib/participoLib/participo.php");
|
require_once 'participoLib/participo.php';
|
||||||
require_once("./lib/participoLib/planer.php");
|
require_once 'participoLib/planer.php';
|
||||||
|
|
||||||
require_once("./auth.php");
|
|
||||||
|
|
||||||
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
|
||||||
require_once($config['basePath']."/config/phpcount.config.php");
|
|
||||||
|
|
||||||
dbConnector::connect(
|
dbConnector::connect(
|
||||||
$cwsvJudoConfig["db"]["host"],
|
$cwsvJudoConfig['db']['host'],
|
||||||
$cwsvJudoConfig["db"]["name"],
|
$cwsvJudoConfig['db']['name'],
|
||||||
$cwsvJudoConfig["db"]["user"],
|
$cwsvJudoConfig['db']['user'],
|
||||||
$cwsvJudoConfig["db"]["password"]
|
$cwsvJudoConfig['db']['password']
|
||||||
);
|
);
|
||||||
|
eventPlaner::setDbConnection(dbConnector::getDbConnection());
|
||||||
|
participo::authentificate();
|
||||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
eventPlaner::setDbConnection( dbConnector::getDbConnection() );
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -32,15 +25,26 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
<?php readfile("./shared/imports.php");?>
|
<?php readfile('./shared/imports.php'); ?>
|
||||||
|
|
||||||
<!-- inits for the materializeCss -->
|
<!-- inits for the materializeCss -->
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
function initSidenav() {
|
||||||
var elems = document.querySelectorAll('.sidenav');
|
var sidenavElements = document.querySelectorAll('.sidenav');
|
||||||
var instances = M.Sidenav.init(elems, {
|
var sidenavInstances = M.Sidenav.init(sidenavElements, {
|
||||||
// specify options here
|
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
function initModals() {
|
||||||
|
var modalElements = document.querySelectorAll('.modal');
|
||||||
|
var modalInstances = M.Modal.init(modalElements, {
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// What to do when the document is loaded.
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// init materialize elements
|
||||||
|
initModals();
|
||||||
|
initSidenav();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -67,7 +71,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
<img alt="cwsvJudoApps" style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php require_once("sidenav/loginStatus.php");?><!-- brings its own li -->
|
<?php require_once 'sidenav/loginStatus.php'; ?><!-- brings its own li -->
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal right-align" href="#mitmachApps">Mitmachen<i class="material-icons">accessibility</i></a>
|
<a class="waves-effect waves-teal right-align" href="#mitmachApps">Mitmachen<i class="material-icons">accessibility</i></a>
|
||||||
</li>
|
</li>
|
||||||
@@ -80,7 +84,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal right-align" href="#configApps">Einstellen<i class="material-icons">settings</i></a>
|
<a class="waves-effect waves-teal right-align" href="#configApps">Einstellen<i class="material-icons">settings</i></a>
|
||||||
</li>
|
</li>
|
||||||
<?php if( isUserAdmin(dbConnector::getDbConnection(), $userData['id']) ){?>
|
<?php if (participo::isUserAdmin($userData['id'])) {?>
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal right-align" href="#admiStuff">adminStuff</a>
|
<a class="waves-effect waves-teal right-align" href="#admiStuff">adminStuff</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -89,30 +93,30 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if($_SESSION['login']){
|
if ($_SESSION['login']) {
|
||||||
?>
|
?>
|
||||||
<main>
|
<main>
|
||||||
<!-- List of Mitmach-Apps -->
|
<!-- List of Mitmach-Apps -->
|
||||||
<h2>Zum Mitmachen</h2>
|
<h2>Zum Mitmachen</h2>
|
||||||
<div class="row" id="mitmachApps">
|
<div class="row" id="mitmachApps">
|
||||||
<?php
|
<?php
|
||||||
echo(
|
echo(
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'link' => "/machs",
|
'link' => '/machs',
|
||||||
'title' => "<em>M</em>ein <em>Ach</em>ievement <em>S</em>ystem",
|
'title' => '<em>M</em>ein <em>Ach</em>ievement <em>S</em>ystem',
|
||||||
'description'=> "Ein kleines Achievementsystem für die tägliche Herausforderung",
|
'description' => 'Ein kleines Achievementsystem für die tägliche Herausforderung',
|
||||||
'imgUrl' => "images/mountain-climber.svg",
|
'imgUrl' => 'images/mountain-climber.svg',
|
||||||
'actions' => [
|
'actions' => [
|
||||||
AppCardAction::fromArray(['caption'=>"MAchS", 'link'=>"/machs"]),
|
AppCardAction::fromArray(['caption' => 'MAchS', 'link' => '/machs']),
|
||||||
],
|
],
|
||||||
])->htmlCode().
|
])->htmlCode() .
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'link' => "/pages/desktop/wkParticipo",
|
'link' => 'events',
|
||||||
'title' => "Event-Planer",
|
'title' => 'Event-Planer',
|
||||||
'description'=> "Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.</p>".eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents())."<p>",
|
'description' => 'Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.' . eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents()),
|
||||||
'imgUrl' => "/ressourcen/graphiken/icons/terminKalender.svg",
|
'imgUrl' => '/ressourcen/graphiken/icons/terminKalender.svg',
|
||||||
'actions' => [
|
'actions' => [
|
||||||
AppCardAction::fromArray(['caption'=>"Planer", 'link'=>"/pages/desktop/wkParticipo"]),
|
AppCardAction::fromArray(['caption' => 'Planer', 'link' => 'events']),
|
||||||
],
|
],
|
||||||
])->htmlCode()
|
])->htmlCode()
|
||||||
)
|
)
|
||||||
@@ -124,26 +128,25 @@ echo(
|
|||||||
<?php
|
<?php
|
||||||
echo(
|
echo(
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'link' => "infoZettel",
|
'link' => 'infoZettel',
|
||||||
'title' => "Infozettel",
|
'title' => 'Infozettel',
|
||||||
'description'=> "Online-Variante der Infozettel und Newsletter",
|
'description' => 'Online-Variante der Infozettel und Newsletter',
|
||||||
'imgUrl' => "images/info.svg",
|
'imgUrl' => 'images/info.svg',
|
||||||
'actions' => [
|
'actions' => [
|
||||||
AppCardAction::fromArray(['caption'=>"Info", 'link'=>"infoZettel"]),
|
AppCardAction::fromArray(['caption' => 'Info', 'link' => 'infoZettel']),
|
||||||
],
|
],
|
||||||
])->htmlCode().
|
])->htmlCode() .
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'link' => "attendance",
|
'link' => 'attendance',
|
||||||
'title' => "Teilnahme",
|
'title' => 'Teilnahme',
|
||||||
'description'=> "Eine kleine Übersicht, wie wie oft man beim Training war",
|
'description' => 'Eine kleine Übersicht, wie wie oft man beim Training war',
|
||||||
'imgUrl' => "http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/calendarIcon.svg",
|
'imgUrl' => 'http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/calendarIcon.svg',
|
||||||
'actions' => [
|
'actions' => [
|
||||||
AppCardAction::fromArray(['caption'=>"Anwesenheit", 'link'=>"attendance"]),
|
AppCardAction::fromArray(['caption' => 'Anwesenheit', 'link' => 'attendance']),
|
||||||
],
|
],
|
||||||
])->htmlCode()
|
])->htmlCode()
|
||||||
);
|
);
|
||||||
// @todo attendanceApp
|
// @todo attendanceApp?>
|
||||||
?>
|
|
||||||
</div> <!-- infoApps -->
|
</div> <!-- infoApps -->
|
||||||
|
|
||||||
<h2>Zum Nachschlagen</h2>
|
<h2>Zum Nachschlagen</h2>
|
||||||
@@ -151,26 +154,25 @@ echo(
|
|||||||
<?php
|
<?php
|
||||||
echo(
|
echo(
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'link' => "kyu",
|
'link' => 'kyu',
|
||||||
'title' => "Kyu",
|
'title' => 'Kyu',
|
||||||
'description'=> "Die Prüfungsprogamme der einzelnen Gürtelstufen in Bild, Ton und Text",
|
'description' => 'Die Prüfungsprogamme der einzelnen Gürtelstufen in Bild, Ton und Text',
|
||||||
'imgUrl' => "images/obi.svg",
|
'imgUrl' => 'images/obi.svg',
|
||||||
'actions' => [
|
'actions' => [
|
||||||
AppCardAction::fromArray(['caption'=>"Kyu-Programme", 'link'=>"kyu"]),
|
AppCardAction::fromArray(['caption' => 'Kyu-Programme', 'link' => 'kyu']),
|
||||||
],
|
],
|
||||||
])->htmlCode().
|
])->htmlCode() .
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'link' => "/JudoWiki",
|
'link' => '/JudoWiki',
|
||||||
'title' => "JudoWiki",
|
'title' => 'JudoWiki',
|
||||||
'description'=> "Ein Wiki zum Thema Judo",
|
'description' => 'Ein Wiki zum Thema Judo',
|
||||||
'imgUrl' => "http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/wikipediaW.svg",
|
'imgUrl' => 'http://cwsvjudo.bplaced.net/ressourcen/graphiken/icons/wikipediaW.svg',
|
||||||
'actions' => [
|
'actions' => [
|
||||||
AppCardAction::fromArray(['caption'=>"JudoWiki", 'link'=>"/JudoWiki"]),
|
AppCardAction::fromArray(['caption' => 'JudoWiki', 'link' => '/JudoWiki']),
|
||||||
],
|
],
|
||||||
])->htmlCode()
|
])->htmlCode()
|
||||||
);
|
);
|
||||||
// @todo horstWolf
|
// @todo horstWolf?>
|
||||||
?>
|
|
||||||
</div><!-- lexiApps -->
|
</div><!-- lexiApps -->
|
||||||
|
|
||||||
<!-- List of ConfigStuff -->
|
<!-- List of ConfigStuff -->
|
||||||
@@ -179,31 +181,29 @@ echo(
|
|||||||
<?php
|
<?php
|
||||||
echo(
|
echo(
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'link' => "user",
|
'link' => 'user',
|
||||||
'title' => "User-Config",
|
'title' => 'User-Config',
|
||||||
'description' => "Einstellungen zum aktuellen Benutzer dessen Kindern",
|
'description' => 'Einstellungen zum aktuellen Benutzer dessen Kindern',
|
||||||
'imgUrl' => "images/account.svg",
|
'imgUrl' => 'images/account.svg',
|
||||||
'actions' => [
|
'actions' => [
|
||||||
AppCardAction::fromArray(['caption'=>"Config", 'link'=>"user"]),
|
AppCardAction::fromArray(['caption' => 'Config', 'link' => 'user']),
|
||||||
],
|
],
|
||||||
])->htmlCode()
|
])->htmlCode()
|
||||||
);
|
); ?>
|
||||||
?>
|
|
||||||
</div> <!-- configApps -->
|
</div> <!-- configApps -->
|
||||||
<?php
|
<?php
|
||||||
// AdminStuff, thats only visible for Admins
|
// AdminStuff, thats only visible for Admins
|
||||||
if( isUserAdmin(dbConnector::getDbConnection(), $userData['id']) ){
|
if (participo::isUserAdmin($userData['id'])) {
|
||||||
echo(
|
echo(
|
||||||
"<h2>AdminStuff</h2>".
|
'<h2>AdminStuff</h2>' .
|
||||||
"<div id=\"admiStuff\" class=\"row\">".
|
'<div id="admiStuff" class="row">' .
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'title' =>"lastLogins",
|
'title' => 'lastLogins',
|
||||||
'description' => "</p>".lastLoginTable()."</p>"
|
'description' => '</p>' . lastLoginTable() . '</p>'
|
||||||
])->htmlCode().
|
])->htmlCode() .
|
||||||
"</div>"
|
'</div>'
|
||||||
);
|
);
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</main>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
require_once 'config/participo.php';
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
|
|
||||||
require_once("participoLib/participo.php");
|
|
||||||
|
|
||||||
require_once("config/participo.php");
|
require_once 'participoLib/participo.php';
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
|
||||||
require_once("./local/cwsvJudo.php");
|
|
||||||
|
|
||||||
require_once("./lib/db.php");
|
require_once './local/dbConf.php';
|
||||||
require_once("./lib/api.php");
|
require_once './local/cwsvJudo.php';
|
||||||
|
|
||||||
require_once("./auth.php");
|
require_once './lib/db.php';
|
||||||
|
require_once './lib/api.php';
|
||||||
|
|
||||||
$basePath = $config['basePath'];
|
$basePath = $config['basePath'];
|
||||||
require_once($basePath."/config/cwsvJudo.config.php");
|
require_once $basePath . '/config/cwsvJudo.config.php';
|
||||||
require_once($basePath."/ressourcen/phpLib/parsedown/Parsedown.php");
|
require_once $basePath . '/ressourcen/phpLib/parsedown/Parsedown.php';
|
||||||
require_once($basePath."/ressourcen/phpLib/Spyc/Spyc.php");
|
require_once $basePath . '/ressourcen/phpLib/Spyc/Spyc.php';
|
||||||
|
|
||||||
|
participo::authentificate();
|
||||||
|
|
||||||
// get a list of all infoZettel
|
// get a list of all infoZettel
|
||||||
$fileList = glob($basePath."/infoZettel/*.md");
|
$fileList = glob($basePath . '/infoZettel/*.md');
|
||||||
rsort($fileList);
|
rsort($fileList);
|
||||||
$years = [];
|
$years = [];
|
||||||
foreach($fileList as $file){
|
foreach ($fileList as $file) {
|
||||||
$years[] = (int)substr(basename($file), 0, 4);
|
$years[] = (int)substr(basename($file), 0, 4);
|
||||||
}
|
}
|
||||||
$years = array_unique($years);
|
$years = array_unique($years);
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -35,7 +32,7 @@ $years = array_unique($years);
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
<?php readfile("./shared/imports.php");?>
|
<?php readfile('./shared/imports.php'); ?>
|
||||||
<!-- adjustments to parsedowncards (smaller headings) -->
|
<!-- adjustments to parsedowncards (smaller headings) -->
|
||||||
<link rel="stylesheet" href="css/parsedownCard.css">
|
<link rel="stylesheet" href="css/parsedownCard.css">
|
||||||
|
|
||||||
@@ -68,14 +65,14 @@ $years = array_unique($years);
|
|||||||
<img style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
<img style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li><?php require_once("sidenav/loginStatus.php");?></li>
|
<li><?php require_once 'sidenav/loginStatus.php'; ?></li>
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal left-align" href="/participo">zurück</a>
|
<a class="waves-effect waves-teal left-align" href="/participo">zurück</a>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
foreach($years as $year){?>
|
foreach ($years as $year) {?>
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal right-align" href="#infoZettel-<?php echo($year);?>"><?php echo($year);?></a>
|
<a class="waves-effect waves-teal right-align" href="#infoZettel-<?php echo($year); ?>"><?php echo($year); ?></a>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@@ -86,37 +83,36 @@ foreach($years as $year){?>
|
|||||||
<main>
|
<main>
|
||||||
<!-- List of Infos -->
|
<!-- List of Infos -->
|
||||||
<div class="row" id="infoList">
|
<div class="row" id="infoList">
|
||||||
<?php
|
<?php
|
||||||
$currentYear = (int)substr(basename($fileList[0]), 0, 4);
|
$currentYear = (int)substr(basename($fileList[0]), 0, 4);
|
||||||
echo("<h2 id=\"infoZettel-".$currentYear."\">".$currentYear."</h2>");
|
echo('<h2 id="infoZettel-' . $currentYear . '">' . $currentYear . '</h2>');
|
||||||
|
|
||||||
foreach($fileList as $file){
|
foreach ($fileList as $file) {
|
||||||
$thisYear = (int)substr(basename($file), 0, 4);
|
$thisYear = (int)substr(basename($file), 0, 4);
|
||||||
if($thisYear != $currentYear){
|
if ($thisYear != $currentYear) {
|
||||||
$currentYear=$thisYear;
|
$currentYear = $thisYear;
|
||||||
echo("<h2 id=\"infoZettel-".$currentYear."\">".$currentYear."</h2>");
|
echo('<h2 id="infoZettel-' . $currentYear . '">' . $currentYear . '</h2>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// get a list of all infoZettel
|
// get a list of all infoZettel
|
||||||
$fileList = glob($basePath."/infoZettel/*.md");
|
$fileList = glob($basePath . '/infoZettel/*.md');
|
||||||
rsort($fileList);
|
rsort($fileList);
|
||||||
|
|
||||||
foreach($fileList as $file){
|
foreach ($fileList as $file) {
|
||||||
$thisYear = (int)substr(basename($file), 0, 4);
|
$thisYear = (int)substr(basename($file), 0, 4);
|
||||||
if($thisYear != $currentYear){
|
if ($thisYear != $currentYear) {
|
||||||
$currentYear=$thisYear;
|
$currentYear = $thisYear;
|
||||||
echo("<h2 id=\"infoZettel-".$currentYear."\">".$currentYear."</h2>");
|
echo('<h2 id="infoZettel-' . $currentYear . '">' . $currentYear . '</h2>');
|
||||||
}
|
}
|
||||||
|
|
||||||
$infoZettel = loadMarkdownFile($file);
|
$infoZettel = loadMarkdownFile($file);
|
||||||
echo(
|
echo(
|
||||||
AppCard::fromArray([
|
AppCard::fromArray([
|
||||||
'title' => $infoZettel['yaml']['title'],
|
'title' => $infoZettel['yaml']['title'],
|
||||||
'description'=> Parsedown::instance()->text( $infoZettel['mdText'] ),
|
'description' => Parsedown::instance()->text($infoZettel['mdText']),
|
||||||
])->htmlCode(['extraClass'=>"parsedownCard"])
|
])->htmlCode(['extraClass' => 'parsedownCard'])
|
||||||
);
|
);
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</div><!-- End of Infos -->
|
</div><!-- End of Infos -->
|
||||||
</main>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once("./config/participo.php");
|
require_once("./config/participo.php");
|
||||||
//require_once("./auth.php");
|
|
||||||
|
|
||||||
require($config['basePath']."/ressourcen/parsedown/Parsedown.php");
|
require_once($config['basePath'] . "/ressourcen/parsedown/Parsedown.php");
|
||||||
require($config['basePath']."/ressourcen/spyc/Spyc.php");
|
require_once($config['basePath'] . "/ressourcen/spyc/Spyc.php");
|
||||||
|
|
||||||
$mdRoot = "markdown/".(array_key_exists('kyu', $_GET)?$_GET['kyu']:"8")."terKyu";
|
$mdRoot = "markdown/".(array_key_exists('kyu', $_GET)?$_GET['kyu']:"8")."terKyu";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// require_once("spyc/Spyc.php");
|
||||||
|
|
||||||
class participo{
|
class participo{
|
||||||
private static $db = null;
|
private static $db = null;
|
||||||
@@ -62,14 +63,17 @@ class participo{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// query all users with the entered name
|
// query *all* users with the entered name
|
||||||
|
// @todo check for e.g., len(user)=1
|
||||||
|
// @todo getUser?
|
||||||
$user = dbConnector::query(
|
$user = dbConnector::query(
|
||||||
"SELECT `id`, `loginName`, `pwHash`, `config` FROM `wkParticipo_Users` WHERE `loginName` = :loginName",
|
"SELECT `id`, `loginName`, `pwHash`, `config` FROM `wkParticipo_Users` WHERE `loginName` = :loginName",
|
||||||
['loginName' => ['value'=>$loginName, 'data_type'=>PDO::PARAM_STR]]
|
['loginName' => ['value'=>$loginName, 'data_type'=>PDO::PARAM_STR]]
|
||||||
);
|
);
|
||||||
|
$user = $user[0];
|
||||||
|
|
||||||
// If there is no such user OR the password isn't valid the login fails
|
// If there is no such user OR the password isn't valid the login fails
|
||||||
if( empty($user || !password_verify( $password, $user['pwHash']) )){
|
if( empty($user) || !password_verify( $password, $user['pwHash'])){
|
||||||
sleep(5); // discourage brute force attacks
|
sleep(5); // discourage brute force attacks
|
||||||
self::addMessage('error', "<div>Falsches Passwort oder LoginName</div>");
|
self::addMessage('error', "<div>Falsches Passwort oder LoginName</div>");
|
||||||
return false;
|
return false;
|
||||||
@@ -80,9 +84,9 @@ class participo{
|
|||||||
$_SESSION = array(
|
$_SESSION = array(
|
||||||
'login' => true,
|
'login' => true,
|
||||||
'user' => array(
|
'user' => array(
|
||||||
'username' => $row['loginName'],
|
'username' => $user['loginName'],
|
||||||
'userId' => $row['id'],
|
'userId' => $user['id'],
|
||||||
'userConfig' => json_decode($row['config'], true)
|
'userConfig' => json_decode($user['config'], true)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -92,6 +96,44 @@ class participo{
|
|||||||
self::addMessage('success', "<div>Anmeldung erfolgreich</div>");
|
self::addMessage('success', "<div>Anmeldung erfolgreich</div>");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks, if a user is an admin
|
||||||
|
*
|
||||||
|
* @param [type] $userId id of the user to check
|
||||||
|
* @retval true user with id $userId has attribute "isAdmin"
|
||||||
|
* @retval false otherwise
|
||||||
|
*/
|
||||||
|
static function isUserAdmin($userId){
|
||||||
|
return self::hasUserAttribute( $userId, "isAdmin");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks, if a user as a certain attribute
|
||||||
|
*
|
||||||
|
* @param [type] $userId id of the user to check
|
||||||
|
* @param [type] $attributeName string name of the attribute to check
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
static public function hasUserAttribute($userId, $attributeName){
|
||||||
|
// sqlQuery: Select the user if it has the given attribute
|
||||||
|
$query = <<<SQL
|
||||||
|
SELECT `wkParticipo_user<=>userAttributes`.userId, `wkParticipo_userAttributes`.name
|
||||||
|
FROM `wkParticipo_user<=>userAttributes` LEFT JOIN `wkParticipo_userAttributes`
|
||||||
|
ON `wkParticipo_user<=>userAttributes`.`attributeId` = `wkParticipo_userAttributes`.`id`
|
||||||
|
WHERE `wkParticipo_userAttributes`.name = :attributeName AND userId=:userId;
|
||||||
|
SQL;
|
||||||
|
$params = array(
|
||||||
|
':userId' => array('value'=>$userId, 'data_type'=>PDO::PARAM_INT),
|
||||||
|
':attributeName' => array('value'=>$attributeName, 'data_type'=>PDO::PARAM_STR)
|
||||||
|
);
|
||||||
|
$attributedUsers = dbConnector::query($query, $params);
|
||||||
|
// Since the id should be unique, there should only be one result this is just for dealing with empty arrays
|
||||||
|
foreach($attributedUsers as $u)
|
||||||
|
if($u['userId']==$userId)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,11 +214,11 @@ class AppCard{
|
|||||||
return
|
return
|
||||||
"<div style=\"padding:1%;\" class=\"col s12 m6 ".$extraClass."\">".
|
"<div style=\"padding:1%;\" class=\"col s12 m6 ".$extraClass."\">".
|
||||||
"<div style=\"margin:1%;\" class=\"card blue-grey darken-1\">".
|
"<div style=\"margin:1%;\" class=\"card blue-grey darken-1\">".
|
||||||
(($this->link!=null)?("<a href=\"".$this->link."\">"):(""))."<div class=\"card-content white-text\">".
|
"<div class=\"card-content white-text\">".
|
||||||
"<span class=\"card-title\">".$this->title."</span>".
|
(($this->link!=null)?("<a href=\"".$this->link."\">"):(""))."<span class=\"card-title\">".$this->title."</span>".(($this->link!=null)?("</a>"):("")).
|
||||||
(($this->imgUrl!=null)?("<img alt=\"".$this->title."\" style=\"display:block;margin-left:auto;margin-right:auto;max-height:10vh;\" class=\"responsive-img\" src=\"".$this->imgUrl."\" />"):("")).
|
(($this->imgUrl!=null)?("<img alt=\"".$this->title."\" style=\"display:block;margin-left:auto;margin-right:auto;max-height:10vh;\" class=\"responsive-img\" src=\"".$this->imgUrl."\" />"):("")).
|
||||||
"<p>".$this->description."</p>".
|
"<p>".$this->description."</p>".
|
||||||
"</div>".(($this->link!=null)?("</a>"):("")).
|
"</div>".
|
||||||
"<div class=\"card-action\">".$actionListCode."</div>".
|
"<div class=\"card-action\">".$actionListCode."</div>".
|
||||||
"</div>".
|
"</div>".
|
||||||
"</div>";
|
"</div>";
|
||||||
@@ -310,6 +352,9 @@ function loadMarkdownFile($fileName){
|
|||||||
function logLoginsToJsonFile($userName, $fileName="lastLogins.json"){
|
function logLoginsToJsonFile($userName, $fileName="lastLogins.json"){
|
||||||
try{
|
try{
|
||||||
$lastLogins = json_decode(file_get_contents($fileName), true);
|
$lastLogins = json_decode(file_get_contents($fileName), true);
|
||||||
|
if ($lastLogins == NULL){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(!array_key_exists($userName, $lastLogins))
|
if(!array_key_exists($userName, $lastLogins))
|
||||||
$lastLogins[$userName] = [];
|
$lastLogins[$userName] = [];
|
||||||
if(!array_key_exists('lastLogins', $lastLogins[$userName]))
|
if(!array_key_exists('lastLogins', $lastLogins[$userName]))
|
||||||
@@ -340,7 +385,7 @@ class dbConnector{
|
|||||||
/// ':userId' => array('value'=>$anUserId, 'data_type'=>PDO::PARAM_INT),
|
/// ':userId' => array('value'=>$anUserId, 'data_type'=>PDO::PARAM_INT),
|
||||||
/// ':attributeId'=> array('value'=>$anAttributeId, 'data_type'=>PDO::PARAM_INT) )
|
/// ':attributeId'=> array('value'=>$anAttributeId, 'data_type'=>PDO::PARAM_INT) )
|
||||||
/// @param $someOption
|
/// @param $someOption
|
||||||
function query($aQueryString, $aBindArray = array(), $someOptions = array()){
|
public static function query($aQueryString, $aBindArray = array(), $someOptions = array()){
|
||||||
// Standardbelegungen
|
// Standardbelegungen
|
||||||
if( empty($someOptions['dbCharset' ]) ) $someOptions['dbCharset' ] = "ISO-8859-1";
|
if( empty($someOptions['dbCharset' ]) ) $someOptions['dbCharset' ] = "ISO-8859-1";
|
||||||
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
|
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
|
||||||
@@ -429,4 +474,70 @@ class dbConnector{
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User for the Participo system
|
||||||
|
*/
|
||||||
|
class user{
|
||||||
|
private $id;
|
||||||
|
private $loginName;
|
||||||
|
private $name;
|
||||||
|
private $firstName;
|
||||||
|
private $dateOfBirth;
|
||||||
|
private $eMail;
|
||||||
|
|
||||||
|
public function __construct($id, $loginName, $name, $firstName, $dateOfBirth, $eMail)
|
||||||
|
{
|
||||||
|
$this->id = (int) id;
|
||||||
|
$this->loginName = $loginName;
|
||||||
|
$this->name = $name;
|
||||||
|
$this->firstName = $firstName;
|
||||||
|
$this->dateOfBirth = $dateOfBirth!=null?DateTime::createFromFormat('Y-m-d', $dateOfBirth):null;
|
||||||
|
$this->eMail = $eMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a User from an assoziative array
|
||||||
|
*
|
||||||
|
* @param array $member associative array with the UserData from the dbRequest
|
||||||
|
* @return User initialized user
|
||||||
|
*/
|
||||||
|
public static function fromArray($member){
|
||||||
|
return new User(
|
||||||
|
$member['id']??null,
|
||||||
|
$member['loginName']??null,
|
||||||
|
$member['name']??null,
|
||||||
|
$member['vorname']??null,
|
||||||
|
$member['gebDatum']??null,
|
||||||
|
array_key_exist('eMail', $member)?explode(',', $member['eMail']):null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Setzen aller Attribute
|
||||||
|
/// @todo Inputvalidation
|
||||||
|
function set($userData){
|
||||||
|
$this->id = $userData["id"];
|
||||||
|
$this->loginName = $userData["loginName"];
|
||||||
|
$this->name = $userData["name"];
|
||||||
|
$this->vorname = $userData["vorname"];
|
||||||
|
$this->gebDatum = $userData["gebDatum"];
|
||||||
|
$this->eMail = $userData["eMail"];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
function toAssoc(){
|
||||||
|
return array(
|
||||||
|
"id" => $this->id,
|
||||||
|
"loginName"=> $this->loginName,
|
||||||
|
"name" => $this->name,
|
||||||
|
"vorname" => $this->vorname,
|
||||||
|
"gebDatum" => $this->gebDatum,
|
||||||
|
"eMail" => $this->eMail);
|
||||||
|
}
|
||||||
|
function loadFromDb($dbConn, $id){
|
||||||
|
$this->set(
|
||||||
|
loadUserDataFromDb($dbConn, $id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
class shiai{
|
* frame for a shiai
|
||||||
|
*/
|
||||||
|
class shiai
|
||||||
|
{
|
||||||
private $id = null; //< unique id
|
private $id = null; //< unique id
|
||||||
private $date = null; //< date of the shiai
|
private $date = null; //< date of the shiai
|
||||||
private $name = null; //< name of the shiai as string
|
private $name = null; //< name of the shiai as string
|
||||||
@@ -12,10 +15,11 @@ class shiai{
|
|||||||
private $galleryUrl = null; //< url of the gallery to a gallery of the shiai
|
private $galleryUrl = null; //< url of the gallery to a gallery of the shiai
|
||||||
private $promoImgUrl = null; //< promotional image for the shiai (as url)
|
private $promoImgUrl = null; //< promotional image for the shiai (as url)
|
||||||
|
|
||||||
function __construct($id, $date, $name, $ageclasses, $place, $announcementUrl, $routeUrl, $galleryUrl, $promoImgUrl){
|
public function __construct($id, $date, $name, $ageclasses, $place, $announcementUrl, $routeUrl, $galleryUrl, $promoImgUrl)
|
||||||
|
{
|
||||||
//! @todo input validation and sanitation
|
//! @todo input validation and sanitation
|
||||||
$this->id = (int) $id;
|
$this->id = (int) $id;
|
||||||
$this->date = DateTime::createFromFormat("Y-m-d", $date);
|
$this->date = DateTime::createFromFormat('Y-m-d', $date);
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->ageclasses = $ageclasses;
|
$this->ageclasses = $ageclasses;
|
||||||
$this->place = $place;
|
$this->place = $place;
|
||||||
@@ -25,32 +29,69 @@ class shiai{
|
|||||||
$this->promoImgUrl = $promoImgUrl;
|
$this->promoImgUrl = $promoImgUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getId()
|
||||||
return $this->name;
|
{
|
||||||
}
|
|
||||||
public function getAgeClasses(){
|
|
||||||
return $this->ageclasses ? $this->ageclasses : "-";
|
|
||||||
}
|
|
||||||
public function getId(){
|
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function fromArray($member){
|
public function getName()
|
||||||
|
{
|
||||||
|
return ($this->name != null ? $this->name : 'Wettkampf ohne Namen');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlDate()
|
||||||
|
{
|
||||||
|
return ($this->date != null ? $this->date->format('Y-m-d') : 'fehlendes Datum');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAgeClasses()
|
||||||
|
{
|
||||||
|
return ($this->ageclasses != null ? $this->ageclasses : '-');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPlace()
|
||||||
|
{
|
||||||
|
return ($this->place != null ? $this->place : '-');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromArray($member)
|
||||||
|
{
|
||||||
return new shiai(
|
return new shiai(
|
||||||
$member['lfdeNr'] ?? null,
|
$member['lfdeNr'] ?? null,
|
||||||
$member['Datum'] ?? null,
|
$member['Datum'] ?? null,
|
||||||
$member['Veranstaltung'] ?? "<fehlender Name>",
|
$member['Veranstaltung'] ?? '<fehlender Name>',
|
||||||
$member['Altersklassen'] ?? null,
|
$member['Altersklassen'] ?? null,
|
||||||
$member['Ort'] ?? "<fehlender Ort>",
|
$member['Ort'] ?? '<fehlender Ort>',
|
||||||
$member['Ausschreibung'] ?? null,
|
$member['Ausschreibung'] ?? null,
|
||||||
$member['Routenplaner'] ?? null,
|
$member['Routenplaner'] ?? null,
|
||||||
$member['galleryLink'] ?? null,
|
$member['galleryLink'] ?? null,
|
||||||
$member['promoPic'] ?? null
|
$member['promoPic'] ?? null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* shiai event as html code for displaying
|
||||||
|
*
|
||||||
|
* @return html formated string
|
||||||
|
*/
|
||||||
|
public function getHtml()
|
||||||
|
{
|
||||||
|
$retHtml = '';
|
||||||
|
$retHtml =
|
||||||
|
'<div>' .
|
||||||
|
'<h3>' . $this->getName() . '</h3>' .
|
||||||
|
'<dl>' .
|
||||||
|
'<dt>Datum:</dt><dd>' . $this->getHtmlDate() . '</dd>' .
|
||||||
|
'<dt>Altersklassen</dt><dd>' . $this->getAgeClasses() . '</dd>' .
|
||||||
|
'<dt>Ort</dt><dd>' . $this->getPlace() . '</dd>' .
|
||||||
|
'</dl>' .
|
||||||
|
'</div>';
|
||||||
|
return $retHtml;
|
||||||
|
}
|
||||||
} // end class shiai
|
} // end class shiai
|
||||||
|
|
||||||
class event{
|
class event
|
||||||
|
{
|
||||||
private $id = null; //< unique id of the event in the db
|
private $id = null; //< unique id of the event in the db
|
||||||
private $date = null; //< date for the event (@todo ranges?)
|
private $date = null; //< date for the event (@todo ranges?)
|
||||||
private $shiaiId = null; //< unique id of the shiai in the db (if appropriate)
|
private $shiaiId = null; //< unique id of the shiai in the db (if appropriate)
|
||||||
@@ -59,54 +100,61 @@ class event{
|
|||||||
|
|
||||||
private $shiai = null;
|
private $shiai = null;
|
||||||
|
|
||||||
function __construct($id, $date, $shiaiId, $deadline, $remarks, $shiai){
|
public function __construct($id, $date, $shiaiId, $deadline, $remarks, $shiai)
|
||||||
|
{
|
||||||
//! @todo InputValidation
|
//! @todo InputValidation
|
||||||
$this->id = (int) $id;
|
$this->id = (int) $id;
|
||||||
$this->date = DateTime::createFromFormat("Y-m-d", $date);
|
$this->date = DateTime::createFromFormat('Y-m-d', $date);
|
||||||
$this->shiaiId = (($shiaiId!=null)?((int)$shiaiId):(null));
|
$this->shiaiId = (($shiaiId != null) ? ((int)$shiaiId) : (null));
|
||||||
$this->deadline = DateTime::createFromFormat("Y-m-d", $deadline);
|
$this->deadline = DateTime::createFromFormat('Y-m-d', $deadline);
|
||||||
$this->remarks = $remarks;
|
$this->remarks = $remarks;
|
||||||
|
|
||||||
$this->shiai = $shiai;
|
$this->shiai = $shiai;
|
||||||
}
|
}
|
||||||
|
|
||||||
function asHtmlCard(){
|
public function asHtmlCard()
|
||||||
return
|
{
|
||||||
"<div class=\"card blue-grey darken-1\">".
|
return
|
||||||
"<div class=\"card-content white-text\">".
|
'<div class="card blue-grey darken-1">' .
|
||||||
"<span class=\"card-title\">".$this->shiai->getName()."</span>".
|
'<div class="card-content white-text">' .
|
||||||
"<dl>".
|
'<span class="card-title">' . $this->shiai->getName() . '</span>' .
|
||||||
"<dt>Datum</dt>".
|
'<dl>' .
|
||||||
"<dd>".$this->date->format("Y-m-d")."</dd>".
|
'<dt>Datum</dt>' .
|
||||||
"<dt>Meldefrist</dt>".
|
'<dd>' . $this->date->format('Y-m-d') . '</dd>' .
|
||||||
"<dd>".$this->deadline->format("Y-m-d")."</dd>".
|
'<dt>Meldefrist</dt>' .
|
||||||
"<dt>Altersklassen</dt>".
|
'<dd>' . $this->deadline->format('Y-m-d') . '</dd>' .
|
||||||
"<dd>".$this->shiai->getAgeClasses()."</dd>".
|
'<dt>Altersklassen</dt>' .
|
||||||
"</div>".
|
'<dd>' . $this->shiai->getAgeClasses() . '</dd>' .
|
||||||
"</div>";
|
'</div>' .
|
||||||
}
|
'</div>';
|
||||||
public function htmlTableRow(){
|
|
||||||
return
|
|
||||||
"<tr>".
|
|
||||||
"<td>Datum ".$this->date->format("Y-m-d")."</td>".
|
|
||||||
"<td><a href=\"/pages/desktop/wkParticipo/showWkEvent.php?eventId=".$this->id."\" >".$this->shiai->getName()."</a></td>".
|
|
||||||
"<td><a class=\"waves-effect waves-light btn-floating modal-trigger\" href=\"#event-modal-".$this->id."\"><i class=\"material-icons\">add</i></a></td>".
|
|
||||||
"</tr>";
|
|
||||||
}
|
|
||||||
public function htmlModal(){
|
|
||||||
return
|
|
||||||
"<div id=\"event-modal-".$this->id."\" class=\"modal\">".
|
|
||||||
"<div class=\"modal-content\">".
|
|
||||||
"<h4>".$this->shiai->getName()."</h4>".
|
|
||||||
"<p>A bunch of text</p>".
|
|
||||||
"</div>". // end modal-content
|
|
||||||
"<div class=\"modal-footer\">".
|
|
||||||
"<a href=\"#!\" class=\"modal-close waves-effect waves-green btn-flat\">Agree</a>".
|
|
||||||
"</div>".
|
|
||||||
"</div>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function fromArray($member){
|
public function htmlTableRow()
|
||||||
|
{
|
||||||
|
return
|
||||||
|
'<tr>' .
|
||||||
|
'<td>' . $this->date->format('Y-m-d') . '</td>' .
|
||||||
|
'<td><a href="/pages/desktop/wkParticipo/showWkEvent.php?eventId=' . $this->id . '" >' . $this->shiai->getName() . '</a></td>' .
|
||||||
|
'<td><a class="waves-effect waves-light btn-floating modal-trigger" href="#event-modal-' . $this->id . '"><i class="material-icons">add</i></a></td>' .
|
||||||
|
'</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function htmlModal()
|
||||||
|
{
|
||||||
|
return
|
||||||
|
'<div id="event-modal-' . $this->id . '" class="modal black-text">' .
|
||||||
|
'<div class="modal-content">' .
|
||||||
|
$this->shiai->getHtml() .
|
||||||
|
'</div>' . // end modal content
|
||||||
|
'<div class="modal-footer">' .
|
||||||
|
'<a href="/pages/desktop/wkParticipo/showWkEvent.php?eventId=' . $this->id . '" class="modal-close waves-effect waves-green btn-flat">Zum Event im Planer</a>' .
|
||||||
|
'<a href="#!" class="modal-close waves-effect waves-green btn-flat">Schließen</a>' .
|
||||||
|
'</div>' .
|
||||||
|
'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fromArray($member)
|
||||||
|
{
|
||||||
$shiai = json_decode($member['bemerkungen'], true);
|
$shiai = json_decode($member['bemerkungen'], true);
|
||||||
|
|
||||||
return new event(
|
return new event(
|
||||||
@@ -115,72 +163,74 @@ class event{
|
|||||||
$member['wkId'] ?? null,
|
$member['wkId'] ?? null,
|
||||||
$member['meldefrist'] ?? null,
|
$member['meldefrist'] ?? null,
|
||||||
$member['bemerkungen'] ?? null,
|
$member['bemerkungen'] ?? null,
|
||||||
shiai::fromArray( ($shiai != null) ? $shiai : $member )
|
shiai::fromArray(($shiai != null) ? $shiai : $member)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // end class event
|
} // end class event
|
||||||
|
|
||||||
class eventPlaner{
|
class eventPlaner
|
||||||
static private $db = null;
|
{
|
||||||
|
private static $db = null;
|
||||||
|
|
||||||
// set the dbConnection (just setting, no establishing)
|
// set the dbConnection (just setting, no establishing)
|
||||||
public static function setDbConnection($dbConnection){
|
public static function setDbConnection($dbConnection)
|
||||||
if($dbConnection instanceof PDO)
|
{
|
||||||
|
if ($dbConnection instanceof PDO) {
|
||||||
self::$db = $dbConnection;
|
self::$db = $dbConnection;
|
||||||
else
|
} else {
|
||||||
self::$db = null;
|
self::$db = null;
|
||||||
return;
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function getCommingWkEvents($someOptions=array() ){
|
public static function getCommingWkEvents($someOptions = [])
|
||||||
|
{
|
||||||
// wir befinden uns in der Übergangsphase:
|
// wir befinden uns in der Übergangsphase:
|
||||||
// - als Standard wird das derzeitige Verhalten definiert (ISO-8859-1
|
// - als Standard wird das derzeitige Verhalten definiert (ISO-8859-1
|
||||||
// und die Konvertierung erfolgt ausserhalb)
|
// und die Konvertierung erfolgt ausserhalb)
|
||||||
// - wenn einmal alle mbConvertEncoding weg sind, kann der Standard auf
|
// - wenn einmal alle mbConvertEncoding weg sind, kann der Standard auf
|
||||||
// das gewünschte Verhalten umgestellt werden
|
// das gewünschte Verhalten umgestellt werden
|
||||||
$dbCharset = $someOptions['dbCharset'] ?? "ISO-8859-1";
|
$dbCharset = $someOptions['dbCharset'] ?? 'ISO-8859-1';
|
||||||
// dbCharset = $someOptions['outCharset'] ?? "UTF-8";// das spätere, gewünschte Verhalten
|
// dbCharset = $someOptions['outCharset'] ?? "UTF-8";// das spätere, gewünschte Verhalten
|
||||||
$outCharset = $someOptions['outCharset'] ?? "ISO-8859-1";
|
$outCharset = $someOptions['outCharset'] ?? 'ISO-8859-1';
|
||||||
|
|
||||||
$query =
|
$query =
|
||||||
"SELECT ".
|
'SELECT ' .
|
||||||
"wkParticipo_Events.id, ".
|
'wkParticipo_Events.id, ' .
|
||||||
"wkParticipo_Events.date, ".
|
'wkParticipo_Events.date, ' .
|
||||||
"wkParticipo_Events.wkId, ".
|
'wkParticipo_Events.wkId, ' .
|
||||||
"wkParticipo_Events.meldefrist, ".
|
'wkParticipo_Events.meldefrist, ' .
|
||||||
"wkParticipo_Events.bemerkungen, ".
|
'wkParticipo_Events.bemerkungen, ' .
|
||||||
"wkParticipo_Events.kvOptions, ".
|
'wkParticipo_Events.kvOptions, ' .
|
||||||
"wettkampfkalender.Datum, ".
|
'wettkampfkalender.Datum, ' .
|
||||||
"wettkampfkalender.Veranstaltung, ".
|
'wettkampfkalender.Veranstaltung, ' .
|
||||||
"wettkampfkalender.Altersklassen, ".
|
'wettkampfkalender.Altersklassen, ' .
|
||||||
"wettkampfkalender.Ort, ".
|
'wettkampfkalender.Ort, ' .
|
||||||
"wettkampfkalender.Ausschreibung, ".
|
'wettkampfkalender.Ausschreibung, ' .
|
||||||
"wettkampfkalender.Routenplaner ".
|
'wettkampfkalender.Routenplaner ' .
|
||||||
"FROM wkParticipo_Events ".
|
'FROM wkParticipo_Events ' .
|
||||||
"LEFT JOIN wettkampfkalender ".
|
'LEFT JOIN wettkampfkalender ' .
|
||||||
"ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
'ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ' .
|
||||||
"WHERE wkParticipo_Events.date >= CURDATE() ".
|
'WHERE wkParticipo_Events.date >= CURDATE() ' .
|
||||||
"ORDER BY wkParticipo_Events.date;";
|
'ORDER BY wkParticipo_Events.date;';
|
||||||
$ret = dbQuery(self::$db, $query);
|
$ret = dbQuery(self::$db, $query);
|
||||||
$events = array();
|
$events = [];
|
||||||
foreach($ret as $event){
|
foreach ($ret as $event) {
|
||||||
array_push( $events, event::fromArray( $event ) );
|
array_push($events, event::fromArray($event));
|
||||||
}
|
}
|
||||||
return $events;
|
return $events;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function getHtmlEventTable($eventList){
|
public static function getHtmlEventTable($eventList)
|
||||||
$ret = "<table>";
|
{
|
||||||
$ret .= "<!-- And now the table -->";
|
$ret = '<table>';
|
||||||
foreach($eventList as $event){
|
foreach ($eventList as $event) {
|
||||||
$ret .= $event->htmlTableRow();
|
$ret .= $event->htmlTableRow();
|
||||||
}
|
}
|
||||||
$ret .= "</table>";
|
$ret .= '</table>';
|
||||||
foreach($eventList as $event){
|
foreach ($eventList as $event) {
|
||||||
$ret .= $event->htmlModal();
|
$ret .= $event->htmlModal();
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
require_once("config/participo.php");
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "./lib/");
|
|
||||||
|
|
||||||
require_once("participoLib/participo.php");
|
require_once("participoLib/participo.php");
|
||||||
require_once("config/participo.php");
|
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
require_once("./local/dbConf.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<!-- MaterializeCss -->
|
<!-- MaterializeCss -->
|
||||||
|
|
||||||
<!-- - Compiled and minified CSS -->
|
<!-- - Compiled and minified CSS -->
|
||||||
<link rel="stylesheet" href="/ressourcen/materializeCss/css/materialize.min.css">
|
<link rel="stylesheet" href="/ressourcen/materializeCss/css/materialize.min.css">
|
||||||
<!-- Compiled and minified JavaScript -->
|
<!-- Compiled and minified JavaScript -->
|
||||||
|
|||||||
@@ -13,3 +13,6 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="kyu.php?kyu=4">4. Kyu - orange-grün</a>
|
<a href="kyu.php?kyu=4">4. Kyu - orange-grün</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="kyu.php?kyu=A">Nage-no-kata</a>
|
||||||
|
</li>
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||||
require_once("config/participo.php");
|
require_once 'config/participo.php';
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
|
||||||
require_once("./local/cwsvJudo.php");
|
|
||||||
|
|
||||||
require_once("./lib/participoLib/participo.php");
|
require_once './local/dbConf.php';
|
||||||
require_once("./lib/db.php");
|
require_once './local/cwsvJudo.php';
|
||||||
require_once("./lib/api.php");
|
|
||||||
|
|
||||||
require_once("./auth.php");
|
require_once './lib/participoLib/participo.php';
|
||||||
|
require_once './lib/db.php';
|
||||||
|
require_once './lib/api.php';
|
||||||
|
|
||||||
|
|
||||||
|
require_once $config['basePath'] . '/config/cwsvJudo.config.php';
|
||||||
|
require_once $config['basePath'] . '/config/phpcount.config.php';
|
||||||
|
|
||||||
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
|
||||||
require_once($config['basePath']."/config/phpcount.config.php");
|
|
||||||
|
|
||||||
dbConnector::connect(
|
dbConnector::connect(
|
||||||
$cwsvJudoConfig["db"]["host"],
|
$cwsvJudoConfig['db']['host'],
|
||||||
$cwsvJudoConfig["db"]["name"],
|
$cwsvJudoConfig['db']['name'],
|
||||||
$cwsvJudoConfig["db"]["user"],
|
$cwsvJudoConfig['db']['user'],
|
||||||
$cwsvJudoConfig["db"]["password"]
|
$cwsvJudoConfig['db']['password']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
participo::authentificate();
|
||||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
$usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
$usersKids = getUsersKids(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
<?php readfile("./shared/imports.php");?>
|
<?php readfile('./shared/imports.php'); ?>
|
||||||
<!-- inits for the materializeCss -->
|
<!-- inits for the materializeCss -->
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
@@ -63,7 +63,7 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<img style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
<img style="max-width:100%;height:12vh;" class="responsive-img" src="http://cwsvjudo.bplaced.net/ressourcen/graphiken/logos/cwsvJudoLogoWappen.x256.png" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li><?php require_once("sidenav/loginStatus.php");?></li>
|
<li><?php require_once 'sidenav/loginStatus.php'; ?></li>
|
||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal" href="/participo">zurück</a>
|
<a class="waves-effect waves-teal" href="/participo">zurück</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -77,20 +77,19 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if($_SESSION['login']){
|
if ($_SESSION['login']) {
|
||||||
?>
|
?>
|
||||||
<main>
|
<main>
|
||||||
<h1>Benutzer-Einstellungen</h1>
|
<h1>Benutzer-Einstellungen</h1>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
if( array_key_exists('changePasswordSuccess', $_GET) ){
|
if (array_key_exists('changePasswordSuccess', $_GET)) {
|
||||||
if($_GET['changePasswordSuccess'] == "true"){
|
if ($_GET['changePasswordSuccess'] == 'true') {
|
||||||
echo("<div>Password geändert</div>");
|
echo('<div>Password geändert</div>');
|
||||||
}else{
|
} else {
|
||||||
echo("<div>Fehler während setzens des Passwortes.</div>");
|
echo('<div>Fehler während des Setzens des Passwortes.</div>');
|
||||||
}
|
}
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</p>
|
</p>
|
||||||
<h2>Benutzer-Info</h2>
|
<h2>Benutzer-Info</h2>
|
||||||
<p>Informationen zum eigenen Benutzerkonto</p>
|
<p>Informationen zum eigenen Benutzerkonto</p>
|
||||||
@@ -99,7 +98,7 @@ if($_SESSION['login']){
|
|||||||
<div style="padding:1%;" class="col s12 m6">
|
<div style="padding:1%;" class="col s12 m6">
|
||||||
<div style="margin:1%;" class="card blue-grey darken-1">
|
<div style="margin:1%;" class="card blue-grey darken-1">
|
||||||
<div class="card-content white-text">
|
<div class="card-content white-text">
|
||||||
<span class="card-title"><?php echo($userData['name']);?>, <?php echo($userData['vorname']); ?></span>
|
<span class="card-title"><?php echo($userData['name']); ?>, <?php echo($userData['vorname']); ?></span>
|
||||||
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
|
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Name</dt><dd><?php echo($userData['name']); ?></dd>
|
<dt>Name</dt><dd><?php echo($userData['name']); ?></dd>
|
||||||
@@ -159,11 +158,11 @@ if($_SESSION['login']){
|
|||||||
<p>Liste der User, für die man meldeberechtigt ist (bzw. Änderungen vornehmen darf). In der Regel ist das das eigene Kind (bei Eltern) oder man selber (bei Volljährigen).</p>
|
<p>Liste der User, für die man meldeberechtigt ist (bzw. Änderungen vornehmen darf). In der Regel ist das das eigene Kind (bei Eltern) oder man selber (bei Volljährigen).</p>
|
||||||
<div class="row" id="kidsList">
|
<div class="row" id="kidsList">
|
||||||
<?php
|
<?php
|
||||||
foreach($usersKids as $kid){ ?>
|
foreach ($usersKids as $kid) { ?>
|
||||||
<div style="padding:1%;" class="col s12 m6">
|
<div style="padding:1%;" class="col s12 m6">
|
||||||
<div style="margin:1%;" class="card blue-grey darken-1">
|
<div style="margin:1%;" class="card blue-grey darken-1">
|
||||||
<div class="card-content white-text">
|
<div class="card-content white-text">
|
||||||
<span class="card-title"><?php echo($kid['name']);?>, <?php echo($kid['vorname']); ?></span>
|
<span class="card-title"><?php echo($kid['name']); ?>, <?php echo($kid['vorname']); ?></span>
|
||||||
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
|
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Name</dt><dd><?php echo($kid['name']); ?></dd>
|
<dt>Name</dt><dd><?php echo($kid['name']); ?></dd>
|
||||||
@@ -173,15 +172,13 @@ if($_SESSION['login']){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="card-title">Passwort</span>
|
<span class="card-title">Passwort</span>
|
||||||
<p>Im folgenden Formular kann das Passwort des Kindes gesetzt werden. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben werden. Das neue Passwort muss zweimal blind eingegeben.</p>
|
<p>Im folgenden Formular kann das Passwort des Kindes gesetzt werden. Damit kann das Kind sich auch in das System einloggen - um z.B. die Wissens-Apps zu benutzen - kann sich aber nicht bei Wettkämpfen anmelden. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben werden. Das neue Passwort muss zweimal blind eingegeben.</p>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
if( ($kid['pwHash'] == "") || ($kid['pwHash']) == NULL ){
|
if (($kid['pwHash'] == '') || ($kid['pwHash']) == null) {
|
||||||
echo("<p>Derzeit ist kein Passwort gesetzt!</p>");
|
echo('<p>Derzeit ist kein Passwort gesetzt!</p>');
|
||||||
}
|
} else {
|
||||||
else{
|
echo('<p>Es ist derzeit ein Passwort gesetzt!</p>'); ?>
|
||||||
echo("<p>Es ist derzeit ein Passwort gesetzt!</p>");
|
|
||||||
?>
|
|
||||||
<p>Es besteht auch die Möglickeit, das Passwort ganz zu entfernen. Man kann sich dann nicht mehr mit diesem Konto einloggen. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben werden.</p>
|
<p>Es besteht auch die Möglickeit, das Passwort ganz zu entfernen. Man kann sich dann nicht mehr mit diesem Konto einloggen. Das eigene Passwort muss dabei noch einmal zur Kontrolle eingegeben werden.</p>
|
||||||
<form action="./user" method="post">
|
<form action="./user" method="post">
|
||||||
<input name="action" type="hidden" value="changePassword" />
|
<input name="action" type="hidden" value="changePassword" />
|
||||||
@@ -237,8 +234,7 @@ if($_SESSION['login']){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
} ?>
|
||||||
?>
|
|
||||||
</main>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user