-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalendari.php
More file actions
54 lines (53 loc) · 985 Bytes
/
Copy pathcalendari.php
File metadata and controls
54 lines (53 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
$mes=date("m");
$any=date("y");
$diaActual=date("d");
$diaSetmana=date("w",mktime(0,0,0,$mes,1,$any))+7;
$ultimDiaMes=date("dm",(mktime(0,0,0,$mes+1,1,$any)-1));
$mesos=array(1=>"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre");
?>
<!DOCTYPE html>
<head>
<title>Calendari</title>
</head>
<body>
<table id="calendar">
<caption><?php echo $mesos[$mes]." ".$any?></caption>
<tr>
<th>Dl.</th>
<th>Dt.</th>
<th>Dc.</th>
<th>Dj.</th>
<th>Dv</th>
<th>Ds</th>
<th>Dg</th>
</tr>
<tr>
<?php
$last_cell=$diaSetmana+$ultimDiaMes;
for($i=1;$i<=42;$i++)
{
if($i==$diaSetmana)
{
$dia=1;
}
if($i<$diaSetmana || $i>=$last_cell)
{
echo "<td> </td>";
}else{
if($dia==$diaActual)
echo "<td class='avui'>$dia</td>";
else
echo "<td>$dia</td>";
$dia++;
}
if($i%7==0)
{
echo "</tr><tr>\n";
}
}
?>
</tr>
</table>
</body>
</html>