2016-08-29 18:27:31 +02:00
|
|
|
<?php
|
|
|
|
date_default_timezone_set('Europe/Oslo');
|
|
|
|
setlocale(LC_ALL, 'no_NO');
|
|
|
|
require __DIR__ . '/../../src/_autoload.php';
|
|
|
|
require __DIR__ . '/../../sql_config.php';
|
|
|
|
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
|
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
$agenda = new \pvv\side\Agenda([
|
|
|
|
new \pvv\side\DBActivity($pdo),
|
|
|
|
]);
|
|
|
|
?><!DOCTYPE html>
|
|
|
|
<html lang="no">
|
|
|
|
<title>Kursverkstedet</title>
|
|
|
|
<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="stylesheet" href="../css/normalize.css">
|
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
2018-02-10 15:04:57 +01:00
|
|
|
<link rel="stylesheet" href="../css/nav.css">
|
2016-08-29 18:27:31 +02:00
|
|
|
<link rel="stylesheet" href="../css/events.css">
|
|
|
|
|
|
|
|
<header>Kurs­verk­stedet</header>
|
|
|
|
|
|
|
|
<main>
|
|
|
|
|
|
|
|
<?php $limit = 0; ?>
|
|
|
|
<?php foreach($agenda->getEventsBetween(new \DateTimeImmutable, (new \DateTimeImmutable)->add(new \DateInterval('P1M'))) as $event) { ?>
|
|
|
|
|
|
|
|
<article>
|
|
|
|
<h2>
|
|
|
|
<?php if ($event->getImageURL()) { ?>
|
|
|
|
<img src="<?= $event->getImageURL() ?>">
|
|
|
|
<?php } ?>
|
|
|
|
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
|
|
|
|
<em><?= $event->getRelativeDate() ?></em>
|
|
|
|
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
|
|
|
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
|
|
|
|
</h2>
|
|
|
|
<ul class="subtext">
|
|
|
|
<li>Tid: <strong><?= trim(strftime('%e. %b %H.%M', $event->getStart()->getTimeStamp())) ?></strong>
|
|
|
|
<li>Sted: <strong><?= $event->getLocation() ?></strong>
|
|
|
|
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<?php $description = $event->getDescription(); ?>
|
|
|
|
<?php if ($limit) array_splice($description, $limit); ?>
|
|
|
|
<?= implode($description, "</p>\n<p>") ?>
|
|
|
|
</article>
|
|
|
|
|
|
|
|
<?php if (!$limit || $limit > 4) {$limit = 4;} else $limit = 2; ?>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
</main>
|
2016-08-29 19:37:49 +02:00
|
|
|
|
|
|
|
<nav><ul>
|
|
|
|
<li><a href="../">hjem</a></li>
|
|
|
|
<li class="active"><a href="../kurs/">kurs</a></li>
|
2017-10-07 21:54:21 +02:00
|
|
|
<li><a href="../kalender/">kalender</a></li>
|
2016-08-30 18:13:31 +02:00
|
|
|
<li><a href="../aktiviteter/">aktiviteter</a></li>
|
2017-10-22 17:57:55 +02:00
|
|
|
<li><a href="../prosjekt/">prosjekter</a></li>
|
2016-08-29 19:37:49 +02:00
|
|
|
<li><a href="../sosiale/">sosiale</a></li>
|
2017-10-22 13:33:14 +02:00
|
|
|
<li><a href="../kontakt/">kontakt</a></li>
|
2016-08-30 18:13:31 +02:00
|
|
|
<li><a href="../pvv/">wiki</a></li>
|
2016-08-29 19:37:49 +02:00
|
|
|
</nav>
|