diff --git a/Activity_PHP/calendar/calendar.php b/Activity_PHP/calendar/calendar.php index d0ea05f..373787c 100644 --- a/Activity_PHP/calendar/calendar.php +++ b/Activity_PHP/calendar/calendar.php @@ -72,7 +72,25 @@ $monthName = $months[$month]; echo(""); } for ($i=6-$day; $i <7 ; $i++) { - echo("$nbr"); + $today = (date("j") == $nbr and date("n") == $month and date("Y") == $year) ? "class='today'" : ""; + echo("$nbr"); + + foreach ($_COOKIE as $nom_cookie => $valeur_cookie) { + $cut = explode("-", $nom_cookie); + + if (count($cut) >= 3) { + $rappelday = $cut[0]; + $rappelmonth = $cut[1]; + $rappelyear = $cut[2]; + + $rappel = ($rappelday == $nbr and $rappelmonth == $month and $rappelyear == $year) ? "
$valeur_cookie" : ""; + } else { + $rappel = "error rappel"; + } + echo($rappel); + } + + echo(""); $nbr++; } @@ -84,8 +102,24 @@ $monthName = $months[$month]; } $today = (date("j") == $nbr and date("n") == $month and date("Y") == $year) ? "class='today'" : ""; - - echo("$nbr"); + echo("$nbr"); + + foreach ($_COOKIE as $nom_cookie => $valeur_cookie) { + $cut = explode("-", $nom_cookie); + + if (count($cut) >= 3) { + $rappelday = $cut[0]; + $rappelmonth = $cut[1]; + $rappelyear = $cut[2]; + + $rappel = ($rappelday == $nbr and $rappelmonth == $month and $rappelyear == $year) ? "
$valeur_cookie" : ""; + } else { + $rappel = "error rappel"; + } + echo($rappel); + } + + echo(""); $nbr++; } echo(""); @@ -94,5 +128,6 @@ $monthName = $months[$month]; + back -> \ No newline at end of file diff --git a/Activity_PHP/calendar/create_rappel.php b/Activity_PHP/calendar/create_rappel.php new file mode 100644 index 0000000..724c5e2 --- /dev/null +++ b/Activity_PHP/calendar/create_rappel.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/Activity_PHP/calendar/index.php b/Activity_PHP/calendar/index.php index 3e4b0b2..b942237 100644 --- a/Activity_PHP/calendar/index.php +++ b/Activity_PHP/calendar/index.php @@ -63,5 +63,43 @@

The calendar generated will display the days of the week as well as the dates for the selected month and year.

+
+

Add a rappel :

+
+ + + + + + + + + + + + +
+