eventsection with at least a list of events
This commit is contained in:
@@ -1,16 +1,49 @@
|
|||||||
/*
|
/*
|
||||||
on large screens add a padding on the left for the fixed sidnav
|
on large screens add a padding on the left for the fixed sidnav
|
||||||
*/
|
*/
|
||||||
header, main, footer {
|
header,
|
||||||
|
main,
|
||||||
|
footer {
|
||||||
padding-left: 300px;
|
padding-left: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width : 992px) {
|
@media only screen and (max-width : 992px) {
|
||||||
header, main, footer {
|
|
||||||
|
header,
|
||||||
|
main,
|
||||||
|
footer {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card video{
|
.card video {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
overrides for the header font sizes
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|||||||
25
homepage/participo/events.inc.php
Normal file
25
homepage/participo/events.inc.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?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/planerLib/planer.php");
|
||||||
|
|
||||||
|
require_once("./auth.php");
|
||||||
|
|
||||||
|
require_once($config['basePath']."/config/cwsvJudo.config.php");
|
||||||
|
|
||||||
|
$dbConnection = getPdoDbConnection(
|
||||||
|
$cwsvJudoConfig["db"]["host"],
|
||||||
|
$cwsvJudoConfig["db"]["name"],
|
||||||
|
$cwsvJudoConfig["db"]["user"],
|
||||||
|
$cwsvJudoConfig["db"]["password"]
|
||||||
|
);
|
||||||
|
eventPlaner::setDbConnection($dbConnection);
|
||||||
|
$userData = getUserData($dbConnection, $_SESSION['user']['userId']);
|
||||||
|
?>
|
||||||
49
homepage/participo/events.php
Normal file
49
homepage/participo/events.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
$meta = array(
|
||||||
|
'title' => "Event Planer",
|
||||||
|
'description' => "Planung von (Nich-)Teilnahmen an Wettkämpfen und anderen Veranstaltungen"
|
||||||
|
);
|
||||||
|
|
||||||
|
include_once("events.inc.php");
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
|
<!-- shared imports (common css, MaterializeCss) -->
|
||||||
|
<?php readfile("./shared/imports.php");?>
|
||||||
|
|
||||||
|
<!-- inits for the materializeCss -->
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
var elems = document.querySelectorAll('.sidenav');
|
||||||
|
var instances = M.Sidenav.init(elems, {
|
||||||
|
// specify options here
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<title><?php echo($meta['title']);?></title>
|
||||||
|
<meta name="description" content=<?php echo($meta['description']);?>])>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<?php readfile("./shared/sidenav.inc.php");?>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<?php if($_SESSION['login']){ ?>
|
||||||
|
<main>
|
||||||
|
<?php echo( eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents()) );?>
|
||||||
|
</main>
|
||||||
|
<?php } ?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class eventPlaner{
|
|
||||||
static private $db = null;
|
|
||||||
function setDbConnection($db){
|
|
||||||
$this->$db = $db;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class shiai{
|
class shiai{
|
||||||
private $id = null; //< unique id
|
private $id = null; //< unique id
|
||||||
@@ -20,9 +14,9 @@ class shiai{
|
|||||||
|
|
||||||
function __construct($id, $date, $name, $ageclasses, $place, $announcementUrl, $routeUrl, $galleryUrl, $promoImgUrl){
|
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;
|
||||||
$this->announcementUrl = $announcementUrl;
|
$this->announcementUrl = $announcementUrl;
|
||||||
@@ -30,18 +24,29 @@ class shiai{
|
|||||||
$this->galleryUrl = $galleryUrl;
|
$this->galleryUrl = $galleryUrl;
|
||||||
$this->promoImgUrl = $promoImgUrl;
|
$this->promoImgUrl = $promoImgUrl;
|
||||||
}
|
}
|
||||||
static public function fromArray($member){
|
|
||||||
$id = $member['lfdeNr'] ?? null;
|
public function getName(){
|
||||||
$date = $member['Datum'] ?? null;
|
return $this->name;
|
||||||
$name = $member['Veranstaltung'] ?? "<fehlender Name>";
|
|
||||||
$ageclasses = $member['Altersklassen'] ?? null;
|
|
||||||
$place = $member['Ort'] ?? "<fehlender Ort>";
|
|
||||||
$announcementUrl = $member['Ausschreibung'] ?? null;
|
|
||||||
$routeUrl = $member['Routenplaner'] ?? null;
|
|
||||||
$galleryUrl = $member['galleryLink'] ?? null;
|
|
||||||
$promoImgUrl = $member['promoPic'] ?? null;
|
|
||||||
}
|
}
|
||||||
}
|
public function getId(){
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function fromArray($member){
|
||||||
|
return new shiai(
|
||||||
|
$member['lfdeNr'] ?? null,
|
||||||
|
$member['Datum'] ?? null,
|
||||||
|
$member['Veranstaltung'] ?? "<fehlender Name>",
|
||||||
|
$member['Altersklassen'] ?? null,
|
||||||
|
$member['Ort'] ?? "<fehlender Ort>",
|
||||||
|
$member['Ausschreibung'] ?? null,
|
||||||
|
$member['Routenplaner'] ?? null,
|
||||||
|
$member['galleryLink'] ?? null,
|
||||||
|
$member['promoPic'] ?? null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // 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?)
|
||||||
@@ -51,14 +56,94 @@ class event{
|
|||||||
|
|
||||||
private $shiai = null;
|
private $shiai = null;
|
||||||
|
|
||||||
function __construct($id, $date, $shiaiId, $deadline, $remarks){
|
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");
|
$this->deadline = DateTime::createFromFormat("Y-m-d", $deadline);
|
||||||
$this->remarks = $remarks;
|
$this->remarks = $remarks;
|
||||||
|
|
||||||
|
$this->shiai = $shiai;
|
||||||
|
}
|
||||||
|
|
||||||
|
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>".
|
||||||
|
"</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function fromArray($member){
|
||||||
|
$shiai = json_decode($member['bemerkungen'], true);
|
||||||
|
|
||||||
|
return new event(
|
||||||
|
$member['id'] ?? null,
|
||||||
|
$member['date'] ?? null,
|
||||||
|
$member['wkId'] ?? null,
|
||||||
|
$member['meldefrist'] ?? null,
|
||||||
|
$member['bemerkungen'] ?? null,
|
||||||
|
shiai::fromArray( ($shiai != null) ? $shiai : $member )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // end class event
|
||||||
|
|
||||||
|
class eventPlaner{
|
||||||
|
static private $db = null;
|
||||||
|
// set the dbConnection (just setting, no establishing)
|
||||||
|
public static function setDbConnection($dbConnection){
|
||||||
|
if($dbConnection instanceof PDO)
|
||||||
|
self::$db = $dbConnection;
|
||||||
|
else
|
||||||
|
self::$db = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function getCommingWkEvents($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(self::$db, $query);
|
||||||
|
$events = array();
|
||||||
|
foreach($ret as $event){
|
||||||
|
array_push( $events, event::fromArray( $event ) );
|
||||||
|
}
|
||||||
|
return $events;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function getHtmlEventTable($eventList){
|
||||||
|
$ret = "<table>";
|
||||||
|
foreach($eventList as $event){
|
||||||
|
$ret .= $event->htmlTableRow();
|
||||||
|
}
|
||||||
|
$ret .= "</table>";
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
39
homepage/participo/shared/sidenav.inc.php
Normal file
39
homepage/participo/shared/sidenav.inc.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<!-- cwsvJudoApps SideNav -->
|
||||||
|
<div>
|
||||||
|
<nav class="indigo darken-4">
|
||||||
|
<h1 style="display:inline;">
|
||||||
|
<?php echo($meta['title']);?>
|
||||||
|
</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( isUserAdmin($dbConnection, $userData['id']) ){?>
|
||||||
|
<li class="bold">
|
||||||
|
<a class="waves-effect waves-teal right-align" href="#Admin">adminStuff</a>
|
||||||
|
</li>
|
||||||
|
<?php }?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user