This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php.bk
96 lines (76 loc) · 3.4 KB
/
index.php.bk
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
date_default_timezone_set('Europe/Copenhagen');
require_once($_SERVER['DOCUMENT_ROOT'].'/libraries/cache.inc');
$openingHours = get_cached_opening_hours();
//Get a random image from a directory of backgrounds
$imagesDir = "img/bg/";
$images = glob($imagesDir.$openingHours["openOrClosed"]."/" . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = (empty($images) ? $imagesDir."/default.jpg" : $images[array_rand($images)]);
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Café Analog</title>
<meta name="description" content="When is Cafe Analog open? This site will show you when Analog is open.">
<meta name="tags" tags="cafe analog open ITU IT-university close analogue caffe">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<link href='http://fonts.googleapis.com/css?family=Gudea|Pathway+Gothic+One' rel='stylesheet' type='text/css'>
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<meta name="google-site-verification" content="GQr_OfGy4IUUx6t3eRJAZXRTFB0uw3Q3GHQ4-qieUsY" />
</head>
<body>
<div id="background">
<img src="<?=$randomImage?>" alt="">
</div>
<div id="openingHours" class="longCaptions">
<h1><?=$openingHours["openOrClosedMessage"]?></h1>
<h2>Scheduled opening hours the next 7 days:</h2>
<ol>
<?php
$maxDaysFromNow = new DateTime();
$maxDaysFromNow->add(new DateInterval('P07D'));
$now = new DateTime('NOW');
for ($i = 0; $i < count($openingHours["open"]); $i++)
{
$currentOpenDateTime = new DateTime($openingHours["open"][$i]);
$currentCloseDateTime = new DateTime($openingHours["close"][$i]);
if ($currentOpenDateTime->format('Ymd') > $maxDaysFromNow->format('Ymd')
|| $currentCloseDateTime < $now)
continue;
echo "<li>";
echo $currentOpenDateTime->format('D jS: H:i - ');
echo $currentCloseDateTime->format('H:i');
/*echo " ("
. $openingHours["employees"][$i] . ")";*/
echo "</li>";
}
?>
</ol>
<a class="email" href="mailto:[email protected]">E-mail us!</a>
<br />
<div class="music-information"></div>
<a class="lastfm-link" href="http://last.fm/user/AnalogIO">View our previous tracklist</a>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.0.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-38442215-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>