Add PDO-activity for reading events from database.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
<?php require '../src/_autoload.php'; date_default_timezone_set('Europe/Oslo') ?><!DOCTYPE html>
|
||||
<?php
|
||||
require '../src/_autoload.php';
|
||||
date_default_timezone_set('Europe/Oslo');
|
||||
//include __DIR__.'/../sql_config.php';
|
||||
?><!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<title>Programvareverkstedet</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
@@ -40,7 +44,12 @@
|
||||
<?php $translation = ['i dag', 'i morgen', 'denne uka', 'denne måned', 'neste måned'] ?>
|
||||
<?php $counter1 = 0; ?>
|
||||
<?php $counter2 = 0; ?>
|
||||
<?php foreach((new \pvv\side\Agenda())->getNextDays() as $period => $events) if ($events && $counter1 < 2 && $counter2 < 10) { $counter1++ ?>
|
||||
<?php $agenda = new \pvv\side\Agenda([
|
||||
new \pvv\side\social\NerdepitsaActivity,
|
||||
new \pvv\side\social\AnimekveldActivity,
|
||||
new \pvv\side\DBActivity('sqlite:../pvv.sqlite', null, null),
|
||||
]); ?>
|
||||
<?php foreach($agenda->getNextDays() as $period => $events) if ($events && $counter1 < 2 && $counter2 < 10) { $counter1++ ?>
|
||||
<li><p><?= $translation[$period] ?> <span><?= reset($events)->getStart()->format('Y-m-d'); ?></span></p>
|
||||
<ul>
|
||||
<?php foreach($events as $event) { $counter2++ ?>
|
||||
|
Reference in New Issue
Block a user