-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
37 lines (28 loc) · 973 Bytes
/
index.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
<?php
header('Content-Type: text/html; charset=utf-8');
include_once('lib/RomanCalendar/RomanCalendar.php');
include_once('lib/RomanCalendar/RomanCalendarRenderHTML.php');
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/RomanCalendar.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<?php
// Test Cases
// 2019 Immaculate conception on sunday
// 2018 annunciaion during holy week
// 1967 St. Joseph during holy week
// 2017 St. Joseph during lent sunday
// 2014 Immaculate Hrt coincided with Saint Irenaeus, 28 June
// 2015 Immaculate Hrt coincided with Saint Anthony of Padua, 13 June
$year = $_GET['year'] ?? date("Y");
$filename = 'dat/' . $year . '/calendar.json';
// If the JSON does not exist in the specified path, then generate it
if (!file_exists($filename)) {
$CalcGen = new RomanCalendar($year);
}
$rHTML = new RomanCalendarRenderHTML();
$rHTML->printYearHTML($year);
?>