81 lines
2.3 KiB
PHP
81 lines
2.3 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 ){
|
|
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);
|
|
}
|
|
|
|
// 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>
|
|
<h1 id="eventList">Übersicht anstehender Events</h1>
|
|
<!-- Table with events-->
|
|
<?php echo( eventPlaner::getHtmlEventTable(eventPlaner::getCommingWkEvents()) );?>
|
|
|
|
<h1 id="detailedEventList">Detailansicht kommender Wettkämpfe</h1>
|
|
<?php foreach( eventPlaner::getCommingWkEvents() as $event ) echo($event->asHtmlCard());?>
|
|
</main>
|
|
<?php } ?>
|
|
</body>
|
|
</html>
|