2018-02-13 19:19:32 +01:00
|
|
|
<?php namespace pvv\side;
|
2018-02-13 19:10:15 +01:00
|
|
|
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
2017-10-07 23:03:53 +02:00
|
|
|
|
|
|
|
$year = (isset($_GET['year']))
|
|
|
|
? $_GET['year']
|
|
|
|
: date("Y");
|
|
|
|
$month = (isset($_GET['month']))
|
|
|
|
? $_GET['month']
|
|
|
|
: date("m");
|
|
|
|
$day = (isset($_GET['day']))
|
|
|
|
? $_GET['day']
|
|
|
|
: -1;
|
|
|
|
|
2017-10-28 17:19:40 +02:00
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
2016-08-26 23:16:51 +02:00
|
|
|
<html lang="no">
|
2018-08-14 02:09:32 +02:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
|
|
|
<link rel="shortcut icon" href="favicon.ico">
|
|
|
|
<link rel="stylesheet" href="../css/normalize.css">
|
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
|
|
<link rel="stylesheet" href="../css/events.css">
|
|
|
|
<title>Aktivitetsverkstedet</title>
|
|
|
|
|
|
|
|
<header>Aktivitets­verk­stedet</header>
|
2016-08-26 23:16:51 +02:00
|
|
|
|
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
<body>
|
|
|
|
<nav>
|
|
|
|
<?php echo navbar(1, 'aktiviteter'); ?>
|
2018-02-24 17:02:00 +01:00
|
|
|
<?php echo loginbar(null, $pdo); ?>
|
2018-02-10 16:23:17 +01:00
|
|
|
</nav>
|
2016-08-26 23:16:51 +02:00
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
<main>
|
|
|
|
<?php
|
2018-02-24 16:53:17 +01:00
|
|
|
use \DateTimeImmutable;
|
2018-02-10 16:23:17 +01:00
|
|
|
$events = ($day==-1)
|
|
|
|
? $agenda->getNextOfEach(new \DateTimeImmutable)
|
|
|
|
: $agenda->getEventsBetween(
|
|
|
|
new DateTimeImmutable("$year-$month-$day 00:00:00"),
|
|
|
|
new DateTimeImmutable("$year-$month-$day 23:59:59"));
|
2016-08-26 23:16:51 +02:00
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
$limit = 0;
|
|
|
|
foreach($events as $event) {
|
|
|
|
?>
|
2018-08-12 03:52:55 +02:00
|
|
|
<article>
|
2018-02-10 16:23:17 +01:00
|
|
|
<h2>
|
|
|
|
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
|
|
|
|
<em><?= $event->getRelativeDate() ?></em>
|
|
|
|
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
|
|
|
<?php if ($event->getURL()) { ?>
|
|
|
|
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
|
|
|
|
<?php } else { ?>
|
|
|
|
<?= $event->getName() ?>
|
|
|
|
<?php } ?>
|
2018-08-12 03:54:39 +02:00
|
|
|
<?php if ($event->getImageURL()) { ?>
|
|
|
|
<img src="<?= $event->getImageURL() ?>">
|
|
|
|
<?php } ?>
|
2018-02-10 16:23:17 +01:00
|
|
|
</h2>
|
|
|
|
<ul class="subtext">
|
|
|
|
<li>Tid: <strong><?= Agenda::getFormattedDate($event->getStart()) ?></strong></li>
|
|
|
|
<li>Sted: <strong><?= $event->getLocation() ?></strong></li>
|
|
|
|
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong></li>
|
|
|
|
</ul>
|
2016-08-26 23:16:51 +02:00
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
<?php $description = $event->getDescription(); ?>
|
|
|
|
<?php if ($limit) array_splice($description, $limit); ?>
|
2018-08-12 03:52:55 +02:00
|
|
|
<?php
|
|
|
|
$Parsedown = new \Parsedown();
|
|
|
|
echo $Parsedown->text(implode("\n", $description));
|
|
|
|
?>
|
|
|
|
</article>
|
2016-08-26 23:16:51 +02:00
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
<?php } ?>
|
|
|
|
</main>
|
2016-08-29 19:37:49 +02:00
|
|
|
|
2018-02-10 16:23:17 +01:00
|
|
|
</body>
|