Commit 1143761cf9ee99ea89b2ac9af17607419125c232

Authored by Jean Wasilewski
1 parent a5d7d11c

Added correct calendar

Showing 1 changed file with 42 additions and 52 deletions   Show diff stats
agenda.php
1 1 <h2> Agenda </h2>
2 2  
  3 +<?php
  4 + $d = new DateTime('now');
  5 + $d->modify('first day of this month');
  6 +// echo $d->format('N');
  7 +?>
  8 +
3 9 <center><table class="table table-striped table-responsive table-bordered">
4 10 <div class="panel_heading">
5 11 <thead>
6 12 <tr>
7   - <th/>
8 13 <th> Lundi </th>
9 14 <th> Mardi </th>
10 15 <th> Mercredi </th>
... ... @@ -16,55 +21,40 @@
16 21 </thead>
17 22 </div >
18 23 <tbody>
19   - <tr>
20   - <th> date </th>
21   - <td> jour </td>
22   - <td> jour </td>
23   - <td> jour </td>
24   - <td> jour </td>
25   - <td> jour </td>
26   - <td> jour </td>
27   - <td> jour </td>
28   - </tr>
29   - <tr>
30   - <th> date </th>
31   - <td> jour </td>
32   - <td> jour </td>
33   - <td> jour </td>
34   - <td> jour </td>
35   - <td> jour </td>
36   - <td> jour </td>
37   - <td> jour </td>
38   - </tr>
39   - <tr>
40   - <th> date </th>
41   - <td> jour </td>
42   - <td> jour </td>
43   - <td> jour </td>
44   - <td> jour </td>
45   - <td> jour </td>
46   - <td> jour </td>
47   - <td> jour </td>
48   - </tr>
49   - <tr>
50   - <th> date </th>
51   - <td> jour </td>
52   - <td> jour </td>
53   - <td> jour </td>
54   - <td> jour </td>
55   - <td> jour </td>
56   - <td> jour </td>
57   - <td> jour </td>
58   - </tr>
59   - <tr>
60   - <th> date </th>
61   - <td> jour </td>
62   - <td> jour </td>
63   - <td> jour </td>
64   - <td> jour </td>
65   - <td> jour </td>
66   - <td> jour </td>
67   - <td> jour </td>
68   - </tr>
69   -</table></center>
  24 +<?php
  25 +for($week=1;$week<6;$week++)
  26 +{
  27 + echo "<tr>";
  28 +
  29 + for($day=1;$day<8;$day++)
  30 + {
  31 + echo "<td>";
70 32  
  33 + if($week==1)
  34 + {
  35 + if($day==$d->format('N'))
  36 + {
  37 + echo $d->format('j');
  38 + $d->modify('next day');
  39 + }
  40 + }
  41 + else if($week==5)
  42 + {
  43 + if($d->format('j')!=1)
  44 + {
  45 + echo $d->format('j');
  46 + $d->modify('next day');
  47 + }
  48 + }
  49 + else
  50 + {
  51 + echo $d->format('j');
  52 + $d->modify('next day');
  53 + }
  54 + echo "</td>";
  55 + }
  56 +
  57 + echo "</tr>";
  58 +}
  59 +?>
  60 +</table></center>
... ...