-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
49 lines (42 loc) · 1.67 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
<?php
header('Content-Type: text/html; charset=utf-8');
include_once 'lib/TamilLectionary/TamilLectionary.php';
include_once 'lib/TamilLectionary/TamilLectionaryUtil.php';
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="year.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<table>
<?php
$year = date ( "Y" );
if (isset ( $_GET ['year'] )) {
if (preg_match ( "/^(19|20)\d{2}$/", $_GET ['year'] ) == 1) { // Years between 1900-2099
$year = $_GET ['year'];
}
}
$CalcGen = new TamilLectionary ( $year, parse_ini_file ( 'lib/RomanCalendar/settings.ini' ) );
//Print year with previous and next links
$rows = "<tr><th colspan=3> <a class='arrowRight' href='index.php?year=" . ($year - 1) . "'>◄</a> $CalcGen->curYear <a class='arrowLeft' href='index.php?year=" . ($year + 1) . "'>►</a> </th></tr>";
foreach ( $CalcGen->fullYear as $month => $value ) {
//Month Name
$rows .= '<tr> <th colspan="3">' . TamilLectionaryUtil::$tamilMonthFull [$month] . '</th> </tr>';
foreach ( $value as $days => $feasts ) {
foreach ( $feasts as $key => $fet ) {
$rows .= '<tr class="Col' . $fet ['color'] . '">';
if ($key == 0) {
$rows .= "<td class='dt' rowspan=" . sizeof ( $feasts ) . ">" . str_pad ( $days, 2, "0", STR_PAD_LEFT ) . "</td>";
}
$type = isset ( $fet ['type'] ) && $fet ['type'] !== 'All Souls' ? ' (' . TamilLectionaryUtil::$tamilFeastType [$fet ['type']] . ')' : '';
$rows .= "<td class='col ColD{$fet ['color']}'></td>";
$rows .= "<td><a class='dayTitle' href='ViewDay.php?dt=$year-$month-$days&k=$key'>{$fet ['ta_name']}$type</a></td>";
$rows .= '</tr>';
}
}
}
echo $rows;
?>
</table>
</body>