This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
2016-08-30 18:13:31 +02:00
|
|
|
<ul id="ticker">
|
|
|
|
<?php
|
|
|
|
{
|
|
|
|
require __DIR__ . '/../src/_autoload.php';
|
|
|
|
require __DIR__ . '/../sql_config.php';
|
2017-10-07 14:19:43 +02:00
|
|
|
$translation = ['i dag', 'i morgen', 'denne uken', 'neste uke', 'denne måneden', 'neste måned'];
|
2016-08-30 18:13:31 +02:00
|
|
|
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
|
|
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
$agenda = new \pvv\side\Agenda([
|
|
|
|
new \pvv\side\social\NerdepitsaActivity,
|
|
|
|
new \pvv\side\social\AnimekveldActivity,
|
|
|
|
new \pvv\side\DBActivity($pdo),
|
|
|
|
]);
|
|
|
|
|
|
|
|
$test = true;
|
|
|
|
foreach($agenda->getNextDays() as $period => $events) {
|
|
|
|
if (!$events) continue;
|
|
|
|
$i = 0;
|
|
|
|
$n = count($events);
|
|
|
|
foreach($events as $event){
|
|
|
|
if ($i == 0){
|
|
|
|
echo '<li style="text-align: center;"><span style="text-transform: uppercase;">' . $translation[$period] . '</span>: ';
|
|
|
|
} else if ($i < $n-1) {
|
|
|
|
echo '<i style="opacity:0.7;">, </i>';
|
|
|
|
} else{
|
|
|
|
echo '<i style="opacity:0.7;"> og </i>';
|
|
|
|
}
|
|
|
|
echo '<a href="' . $event->getURL() . '">' . $event->getName() . '</a>';
|
|
|
|
$i = $i + 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|