Browse Source

date events are got from database

master
n0m1s 10 years ago
parent
commit
bfb50b8035
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      index.php

+ 12
- 2
index.php View File

@ -1,3 +1,8 @@
<?php
session_start();
include_once('getEvents.php');
$db = connect();
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -81,6 +86,8 @@
<ul class="week">'); <ul class="week">');
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 = ''; $class = '';
if(date('m', $date) != date('m')) if(date('m', $date) != date('m'))
$class .= ' otherMonth'; $class .= ' otherMonth';
@ -91,8 +98,11 @@
echo(' echo('
<li class="day'.$class.'"> <li class="day'.$class.'">
<h2>'.date("d", $date).'</h2> <h2>'.date("d", $date).'</h2>
<ul>
<li class="calendar-link">10h : Conférence - Domotique</li>
<ul>');
foreach($events as $event)
echo('<li class="calendar-link">'.$event['titre']."</li>");
echo('
</ul> </ul>
</li>'); </li>');
} }


Loading…
Cancel
Save