redirecting login
This commit is contained in:
@@ -1,110 +1,30 @@
|
||||
<?php
|
||||
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
||||
require_once("config/participo.php");
|
||||
|
||||
|
||||
require_once("./local/dbConf.php");
|
||||
require_once("./local/cwsvJudo.php");
|
||||
|
||||
require_once("./lib/db.php");
|
||||
require_once("./lib/api.php");
|
||||
require_once("./lib/participoLib/participo.php");
|
||||
require_once("./lib/participoLib/planer.php");
|
||||
|
||||
require_once("./auth.php");
|
||||
|
||||
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
||||
require_once($config['basePath']."/config/phpcount.config.php");
|
||||
|
||||
$dbConnection = getPdoDbConnection(
|
||||
dbConnector::connect(
|
||||
$cwsvJudoConfig["db"]["host"],
|
||||
$cwsvJudoConfig["db"]["name"],
|
||||
$cwsvJudoConfig["db"]["user"],
|
||||
$cwsvJudoConfig["db"]["password"]
|
||||
);
|
||||
$userData = getUserData($dbConnection, $_SESSION['user']['userId']);
|
||||
|
||||
function getCommingWkEvents($dbConn, $someOptions=array() ){
|
||||
// wir befinden uns in der Übergangsphase:
|
||||
// - als Standard wird das derzeitige Verhalten definiert (ISO-8859-1
|
||||
// und die Konvertierung erfolgt ausserhalb)
|
||||
// - wenn einmal alle mbConvertEncoding weg sind, kann der Standard auf
|
||||
// das gewünschte Verhalten umgestellt werden
|
||||
$dbCharset = $someOptions['dbCharset'] ?? "ISO-8859-1";
|
||||
// dbCharset = $someOptions['outCharset'] ?? "UTF-8";// das spätere, gewünschte Verhalten
|
||||
$outCharset = $someOptions['outCharset'] ?? "ISO-8859-1";
|
||||
|
||||
$query =
|
||||
"SELECT ".
|
||||
"wkParticipo_Events.id, ".
|
||||
"wkParticipo_Events.date, ".
|
||||
"wkParticipo_Events.wkId, ".
|
||||
"wkParticipo_Events.meldefrist, ".
|
||||
"wkParticipo_Events.bemerkungen, ".
|
||||
"wkParticipo_Events.kvOptions, ".
|
||||
"wettkampfkalender.Datum, ".
|
||||
"wettkampfkalender.Veranstaltung, ".
|
||||
"wettkampfkalender.Altersklassen, ".
|
||||
"wettkampfkalender.Ort, ".
|
||||
"wettkampfkalender.Ausschreibung, ".
|
||||
"wettkampfkalender.Routenplaner ".
|
||||
"FROM wkParticipo_Events ".
|
||||
"LEFT JOIN wettkampfkalender ".
|
||||
"ON wettkampfkalender.lfdeNr = wkParticipo_Events.wkId ".
|
||||
"WHERE wkParticipo_Events.date >= CURDATE() ".
|
||||
"ORDER BY wkParticipo_Events.date;";
|
||||
$ret = dbQuery($dbConn, $query);
|
||||
// $results = $anMysqlConn->query($query);
|
||||
|
||||
// // Bei einem Fehler bei der Abfrage soll NULL zurückgeliefert werden
|
||||
// if( !$results ){
|
||||
// echo("No Results: ".$anMysqlConn->error);
|
||||
// return NULL;
|
||||
// }
|
||||
// // Bei einem leeren Ergebnis (NULL oder leeres Array) soll ein leeres Array zurückgeliefert werden
|
||||
// if( empty($results) ) return array();
|
||||
|
||||
// while( $result = $results->fetch_assoc() ){
|
||||
// array_walk(
|
||||
// $result,
|
||||
// function (&$value, $key, $someOptions) {
|
||||
// $value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
|
||||
// },
|
||||
// $someOptions
|
||||
// );
|
||||
// array_push( $ret, $result);
|
||||
// }
|
||||
return $ret;
|
||||
}
|
||||
$userData = getUserData(dbConnector::getDbConnection(), $_SESSION['user']['userId']);
|
||||
eventPlaner::setDbConnection( dbConnector::getDbConnection() );
|
||||
|
||||
// array(12) {
|
||||
// ["id"]=> string(3) "139"
|
||||
// ["date"]=> string(10) "2021-12-29"
|
||||
// ["wkId"]=> string(0) ""
|
||||
// ["meldefrist"]=> string(10) "2021-12-28"
|
||||
// ["bemerkungen"]=> string(374) "{ "Datum": "2021-12-29", "Veranstaltung": "Jahresabschlusstraining", "Altersklassen": "alle", "bemerkungen": "
|
||||
|
||||
// Zum Abschluss des Jahres noch einmal eine kleine Einheit hauptsächlich zum Spielen
|
||||
// Zeit: 16:00--19:00 Uhr
|
||||
|
||||
// ", "Ort": "unser Dojo, Str. Usti nad Labem 42, 09120 Chemnitz", "Routenplaner": "https://osm.org/go/0MIYhLf3Q-" }"
|
||||
// ["kvOptions"]=> string(0) ""
|
||||
// ["Datum"]=> string(0) ""
|
||||
// ["Veranstaltung"]=> string(0) ""
|
||||
// ["Altersklassen"]=> string(0) ""
|
||||
// ["Ort"]=> string(0) ""
|
||||
// ["Ausschreibung"]=> string(0) ""
|
||||
// ["Routenplaner"]=> string(0) ""
|
||||
// }
|
||||
function getHtmlEventTable($eventList){
|
||||
$ret = "</a><table>";
|
||||
foreach($eventList as $event){
|
||||
$e = json_decode($event['bemerkungen'], true);
|
||||
$e = (($e==null)?$event:$e);
|
||||
$e['id']=$event['id'];
|
||||
$ret .= "<tr><td>".$e['Datum']."</td><td><a href=\"/pages/desktop/wkParticipo/showWkEvent.php?eventId=".$e['id']."\" >".$e['Veranstaltung']."</a></td></tr>";
|
||||
}
|
||||
$ret .= "</table><a>";
|
||||
return $ret;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -160,9 +80,9 @@ function getHtmlEventTable($eventList){
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal right-align" href="#configApps">Einstellen<i class="material-icons">settings</i></a>
|
||||
</li>
|
||||
<?php if( isUserAdmin($dbConnection, $userData['id']) ){?>
|
||||
<?php if( isUserAdmin(dbConnector::getDbConnection(), $userData['id']) ){?>
|
||||
<li class="bold">
|
||||
<a class="waves-effect waves-teal right-align" href="#Admin">adminStuff</a>
|
||||
<a class="waves-effect waves-teal right-align" href="#admiStuff">adminStuff</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
@@ -189,7 +109,7 @@ echo(
|
||||
AppCard::fromArray([
|
||||
'link' => "/pages/desktop/wkParticipo",
|
||||
'title' => "Event-Planer",
|
||||
'description'=> "Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.</p>".getHtmlEventTable(getCommingWkEvents($dbConnection))."<p>",
|
||||
'description'=> "Organisieren der Teilnahmen (und nicht-Teilnahmen) an Wettkämpfen, Sondertrainingseinheiten, Feiern etc.</p>".eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents())."<p>",
|
||||
'imgUrl' => "/ressourcen/graphiken/icons/terminKalender.svg",
|
||||
'actions' => [
|
||||
AppCardAction::fromArray(['caption'=>"Planer", 'link'=>"/pages/desktop/wkParticipo"]),
|
||||
@@ -272,7 +192,7 @@ echo(
|
||||
</div> <!-- configApps -->
|
||||
<?php
|
||||
// AdminStuff, thats only visible for Admins
|
||||
if( isUserAdmin($dbConnection, $userData['id']) ){
|
||||
if( isUserAdmin(dbConnector::getDbConnection(), $userData['id']) ){
|
||||
echo(
|
||||
"<h2>AdminStuff</h2>".
|
||||
"<div id=\"admiStuff\" class=\"row\">".
|
||||
|
||||
Reference in New Issue
Block a user