From a2703988f0812385a888be9cac8524a39b68869f Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sat, 7 Oct 2017 21:25:51 +0200 Subject: [PATCH] Add calendar --- www/css/calendar.css | 65 ++++++++++++++++++++++++++ www/kalender/index.php | 102 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 www/css/calendar.css create mode 100644 www/kalender/index.php diff --git a/www/css/calendar.css b/www/css/calendar.css new file mode 100644 index 0000000..6551c21 --- /dev/null +++ b/www/css/calendar.css @@ -0,0 +1,65 @@ +figure.calendar { + margin: 0; + padding:0; +} + +.calendar ul { + list-style-type: none; + padding-left:0; + + display: grid; + grid-template-columns: repeat(7, 4fr); + grid-template-rows: auto; +} + + +.calendar ul li { + margin: 2px; + + border-style: solid; + border-color: #e0e0e0; + border-width: 1px; + border-radius: 5px; + + background-color: #f3f3f3; + padding: 0.2em 0.5em; + padding-bottom: 0.5em; + min-height: 4.8em; + font-size: 0.8em; + color: #444; + + transition: 0.1s; +} + +.calendar ul li.header { + text-align: center; + min-height: 1em; + + background-color: #fff; + border: None; + border-radius: 0; + margin: 0px; + padding: 0.2em 0; + font-size: 1em; + font-weight: 500; + color: #666; +} +.calendar ul li.outOfMonth { + opacity: 0; +} + +.calendar ul li.active { + color: #222; + border-color: #456; + box-shadow: 0 0 3px #89f; +} + +.calendar ul li:hover { + background-color: #fff; +} + + +.calendar ul li section::before { + content: "\26AB "; + color: #038; +} diff --git a/www/kalender/index.php b/www/kalender/index.php new file mode 100644 index 0000000..1d9b32d --- /dev/null +++ b/www/kalender/index.php @@ -0,0 +1,102 @@ +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\social\BrettspillActivity, + new \pvv\side\DBActivity($pdo), +]); + +$year = (isset($_GET['year'])) + ? $_GET['year'] + : date("Y"); +$month = (isset($_GET['month'])) + ? $_GET['month'] + : date("m"); +$days_before_the_first = (new DateTime($year."-".$month."-01"))->format("w") - 1; +if ($days_before_the_first==-1) {$days_before_the_first = 6;} +$day_of_month = ($month == date("m")) + ? date("j") + : -1; +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); + +?> + +Aktivitetsverkstedet + + + + + + + +
Aktivitets­verk­stedet
+ +
+ +
+

Aktiviteter for

+ +

+ Forrige måned + Neste måned +

+ + +
+
    +
  • Mandag +
  • Tirsdag +
  • Onsdag +
  • Torsdag +
  • Fredag +
  • Lørdag +
  • Søndag + + +
  • + + + + + getEventsBetween( + new DateTimeImmutable("$year-$month-$day 00:00:00"), + new DateTimeImmutable("$year-$month-$day 23:59:59")); ?> + +
  • + +
  • + + + +
    getName()?>
    + + + +
+
+ +
+ +
+ +