97 lines
2.8 KiB
PHP
97 lines
2.8 KiB
PHP
<?php
|
|
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>
|
|
function initSidenav() {
|
|
var sidenavElements = document.querySelectorAll('.sidenav');
|
|
var sidenavInstances = M.Sidenav.init(sidenavElements, {
|
|
});
|
|
};
|
|
function initModals() {
|
|
var modalElements = document.querySelectorAll('.modal');
|
|
var modalInstances = M.Modal.init(modalElements, {
|
|
});
|
|
};
|
|
function openEventModal(eventId){
|
|
openModal(`#event-modal-${eventId}`);
|
|
}
|
|
function openModal(modalId){
|
|
var modalElement = document.querySelector(modalId);
|
|
if( modalElement === null ){
|
|
return;
|
|
}
|
|
var modalInstance = M.Modal.getInstance(modalElement);
|
|
modalInstance.open();
|
|
}
|
|
|
|
// What to do when the document is loaded.
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// init materialize elements
|
|
initModals();
|
|
initSidenav();
|
|
|
|
// opening event modal if given
|
|
var eventId = parseInt( window.location.hash.substr(1) );
|
|
if( !isNaN(eventId) ){
|
|
openEventModal(eventId);
|
|
}
|
|
});
|
|
</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>
|
|
<!-- The sidenav -->
|
|
<?php require './events.sidenav.inc.php'; ?>
|
|
</header>
|
|
|
|
<?php if ($_SESSION['login']) { ?>
|
|
<main>
|
|
<?php
|
|
$eventList = participo::getEventStarter();
|
|
$htmlTable = null;
|
|
if ($eventList) {
|
|
$htmlTable = '<table>'
|
|
. '<thead><tr><th>Datum</th><th>Veranstaltung</th><th>Starter</th></tr></thead>'
|
|
. '<tbody>';
|
|
foreach ($eventList as $event) {
|
|
$htmlTable .= '<tr><td>' . $event['eventDate'] . '</td><td>' . $event['eventName'] . '</td><td>' . $event['userName'] . ', ' . $event['userFirstname'] . '</td></tr>';
|
|
}
|
|
$htmlTable .= '</tbody></table>';
|
|
echo('<h2 id="commingStarts">Aktuelle Einschreibungen</h2>');
|
|
echo($htmlTable);
|
|
} else {
|
|
echo($eventList ? $htmlTable : '<div>Keine Meldungen zu bevorstehenden Events');
|
|
}
|
|
?>
|
|
<h2 id="eventList">Übersicht anstehender Events</h2>
|
|
<!-- Table with events-->
|
|
<?php echo(eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents())); ?>
|
|
|
|
<h2 id="detailedEventList">Detailansicht kommender Wettkämpfe</h2>
|
|
<?php foreach (eventPlaner::getCommingWkEvents() as $event) {
|
|
echo($event->asHtmlCard());
|
|
}?>
|
|
</main>
|
|
<?php } ?>
|
|
</body>
|
|
</html>
|