From c49b3e76c261adcdfe60e3ad606de75587602115 Mon Sep 17 00:00:00 2001 From: TheMrNomis Date: Thu, 12 Nov 2015 09:49:36 +0100 Subject: [PATCH] calendar view changed a bit + implemented the month at the bottom of the window --- index.css | 21 +++++++++++++++++++- index.php | 58 +++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 9 deletions(-) diff --git a/index.css b/index.css index 9c9b8a4..02eecde 100755 --- a/index.css +++ b/index.css @@ -178,6 +178,7 @@ input[type="checkbox"]:checked + label span { /*Calendar*/ #calendar { margin-top:60px; + overflow-y: auto; } #calendar .week { @@ -215,11 +216,24 @@ input[type="checkbox"]:checked + label span { } #calendar .week .day h2 { - font-size: 30px; + font-size: 2em; margin: 20px; color: #2B2B2B; } +#calendar .week .day h2 .minititle { + font-size: 0.5em; + color: #4B4B4B; +} + +#calendar .week .day h2 .left{ + margin-right: 0.5em; +} + +#calendar .week .day h2 .right{ + margin-left: 0.0em; +} + #calendar .week .otherMonth h2 { color: #4B4B4B; } @@ -228,3 +242,8 @@ input[type="checkbox"]:checked + label span { margin-left: -20px; font-size:12px; } + +#calendar .week .day .calendar-link a { + color: black; + text-decoration: none; +} diff --git a/index.php b/index.php index c339967..60f0213 100644 --- a/index.php +++ b/index.php @@ -2,6 +2,31 @@ session_start(); include_once('getEvents.php'); $db = connect(); + +$days = array( + 1 => "Lun", + 2 => "Mar", + 3 => "Mer", + 4 => "Jeu", + 5 => "Ven", + 6 => "Sam", + 7 => "Dim" +); +$months = array( + 1 => "Janvier", + 2 => "Fevrier", + 3 => "Mars", + 4 => "Avril", + 5 => "Mai", + 6 => "Juin", + 7 => "Juillet", + 8 => "Août", + 9 => "Septembre", + 10 => "Octobre", + 11 => "Novembre", + 12 => "Decembre" +); + ?> @@ -80,16 +105,26 @@ $db = connect();
'); - for($date = strtotime('last monday +'.$week.' weeks'); $date < strtotime('next monday +'.$week.' weeks'); $date = strtotime('+1 day', $date)) + for($date = strtotime('last monday +'.$week.' weeks'); + $date < strtotime('next monday +'.$week.' weeks'); + $date = strtotime('+1 day', $date) + ) { $events = getEventsByDate($db, $date); $class = ''; - if(date('m', $date) != date('m')) + if(date('m', $date) != date('m', $monthDate)) $class .= ' otherMonth'; if(date('Y-m-d', $date) == date('Y-m-d')) @@ -97,11 +132,18 @@ $db = connect(); echo('
  • -

    '.date("d", $date).'

    +

    + '.$days[date("N",$date)].' + '.date("d", $date)); + if(date('m', $date) != date('m', $monthDate)) + echo(' + /'.date("m",$date).''); + echo(' +

      '); foreach($events as $event) - echo('"); + echo('"); echo('
  • '); @@ -114,9 +156,9 @@ $db = connect();