-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarlendar.php
More file actions
72 lines (62 loc) · 2.39 KB
/
carlendar.php
File metadata and controls
72 lines (62 loc) · 2.39 KB
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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="cal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
$months = array("31","28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");
$name = array("Jan", "Feb", "Mar", "Apr", "May", "June", "July","Aug", "Sept", "Oct", "Nov", "Dec");
$StartingPoint = 1;
for ($thismonth = 0; $thismonth < count($months); $thismonth++)
{
?>
<table>
<tr><th>S</th><th>M</th><th>T</th><th>W</th><th>TH</th><td>F</th><th>SA</th></tr>
<tr>
<?php
$counter = 1;
$pos = 1;
for ($free = 1; $free < $StartingPoint; $free++)
{
$counter++;
?>
<td></td>
<?php
}
for ($day = 1; $day <=$months[$thismonth]; $day++)
{
?>
<td><?php echo ($day); ?></td>
<?php
if (($counter % 7) == 0)
{
$pos = 1;
?>
</tr><tr>
<?php
}
else
{
$pos++;
}
$counter++;
if (($day == $months[$thismonth]) && ($pos != 1))
{
$StartingPoint = $pos;
}
}
}
?>
</tr>
</table>
</body>
</html>