Blame view

agenda.php 935 Bytes
97d25235   Erwan Nanrocki   ajout d un titre ...
1
2
  <h2> Agenda </h2>
  
1143761c   Jean Wasilewski   Added correct cal...
3
4
5
6
7
8
  <?php
      $d = new DateTime('now');
      $d->modify('first day of this month');
  //    echo $d->format('N');
  ?>
  
84cbf3e0   Sandra Hage   modification de l...
9
  <center><table class="table table-striped table-responsive table-bordered">
0488178d   Sandra Hage   modification de l...
10
11
12
  	<div class="panel_heading">
  	     <thead>
  		<tr> 
0488178d   Sandra Hage   modification de l...
13
14
15
16
17
  		     <th> Lundi </th>
  		     <th> Mardi </th>
  		     <th> Mercredi </th>
  		     <th> Jeudi </th>
  		     <th> Vendredi </th>
d625e311   Sandra Hage   modification de l...
18
19
  		     <th> Samedi </th>
  		     <th> Dimanche </th>
0488178d   Sandra Hage   modification de l...
20
21
22
  		</tr>
  	     </thead>
  	 </div >
ee1cb73c   Sandra Hage   modification de l...
23
  	 <tbody>
1143761c   Jean Wasilewski   Added correct cal...
24
25
26
27
28
29
30
31
  <?php
  for($week=1;$week<6;$week++)
  {
  	echo "<tr>";
  
  	for($day=1;$day<8;$day++)
  	{
  		echo "<td>";
22d8fe88   Sandra Hage   Agenda modifie
32
  
1143761c   Jean Wasilewski   Added correct cal...
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  		if($week==1)
  		{
  			if($day==$d->format('N'))
  			{
  				echo $d->format('j');
  				$d->modify('next day');
  			}
  		}
  		else if($week==5)
  		{
  			if($d->format('j')!=1)
  			{
  				echo $d->format('j');
  				$d->modify('next day');
  			}
  		}
  		else
  		{
  			echo $d->format('j');
  			$d->modify('next day');
  		}
  		echo "</td>";
  	}
  
  	echo "</tr>";
  }
  ?>
  </table></center>