-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendari.php
76 lines (62 loc) · 1.35 KB
/
calendari.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
b{color: red;}
th,td{background: blue;}
</style>
</head>
<table>
<tr>
<th>Dilluns</th>
<th>Dimarts</th>
<th>Dimecres</th>
<th>Dijous</th>
<th>Divendres</th>
<th>Dissabte</th>
<th>Diumenge</th>
</tr>
<?php
$numdia = 1;
$month=date("n");
$dias=array("Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres", "Dissabte");
$mesos=array("Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost", "Setembre","Octubre","Novembre","Desembre");
$year=date("Y");
$day = date("d");
$numtotalmes = date("d",(mktime(0,0,0,$month+1,1,$year)-1));
$diaSemana=date("w",mktime(0,0,0,$month,1,$year));
echo "<p>".$mesos[$month-1]."</p>";
$diainici = 1;
//echo date("F");;
//echo date("Y");
//$diaavui = date(string $format [, int $timestamp = time() ] );
for ($t=0; $t < 7; $t++) {
echo $mesos[date('t')-1];
}
for ($i=0; $i < 6; $i++) {
echo "<tr>";
for ($y=0; $y < 7; $y++) {
if ($diainici != $diaSemana) {
$diainici += 1;
echo "<td> </td>";
} else {
if ($numdia == $day) {
echo "<td><b><u>".$numdia."</u></b></td>";
} else {
echo "<td>".$numdia."</td>";
}
$numdia += 1;
}
if ($numdia == $numtotalmes+1) {
$i = 6;
$y = 8;
}
}
echo "</tr>";
}
?>
</table>
</body>
</html>