-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalendar.html
53 lines (40 loc) · 1.03 KB
/
Calendar.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>AquaCalendar</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<?php
function Calendar()
{
$thisYearNum = date('Y');
$thisMonthNum = date('m');
$thisMonth = date('F');
$thisDayNum = date('d');
/* Get number of days in month */
$daysInMonth = cal_days_in_month(CAL_GREGORIAN, $thisMonthNum, $thisYearNum);
$monthArray = array();
/* Add in empty days to the array until today's day */
for ($i = 1; i < $thisDayNum; $i++)
{
$monthArray[] = -1;
}
/* Now add each day to the array */
for ($i = 1; $i <= $daysInMonth; $i++)
{
$monthArray[] = $i;
}
/* Finally output it */
foreach($monthArray as $day)
{
if ($day == -1)
$day = "";
echo "<div class=\"calendarday\"><div class=\"calendardaynum\">$day</div></div>";
}
}
Calendar();
?>
</body>
</html>