-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_old.php
117 lines (95 loc) · 4.1 KB
/
index_old.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
if((!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != "on") && $_SERVER["HTTP_HOST"] != "localhost")
{
header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
exit();
}
$open = true;
global $open;
include_once("scripts/debug.php");
$loggedIn = false;
$user = "";
$priv = 0;
session_start();
if(isset($_SESSION['username'])){
$loggedIn = true;
$user = $_SESSION['username'];
//$priv = $_SESSION['permissions'];
} else {
}
$start = "2018-08-17";
$timeOffset = $_SERVER["HTTP_HOST"] != "localhost" ? "+12 hours" : ""; //Offset is +12 hours, but is not offset when hosted locally
//header("Location: register.php");
$your_date = strtotime($start . " " . $timeOffset);
$datediff = $your_date - time();
$days = floor($datediff / (60 * 60 * 24));
global $days;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="Toby Strange (StrangeOne101)">
<!--<meta name="robots" content="noindex"> <!-- This has been commented out as a trial to let google index the page -->
<!--<meta name="googlebot" content="noindex"> -->
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title>Space Camp - Home</title>
<!-- Bootstrap Core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/index.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.ico">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="js/debug.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="tile">
<div class="center" id="title_center">
<!--<h3>Space Camp... Lift Off In...</h3>
<h1 id="sac-timer"><?php echo $days?> Days</h1>
<input id="register-btn" type="button" class="btn btn-large btn-lg" title="Register" value="Register Here!" onclick="document.location='/register.php'">
<h5>Registrations close on August 11th</h5>-->
<div id="banner">
<img src="img/header_t.png" width="80%">
<h3 style="margin-top: -20px">SPACE CAMP! LIFT OFF IN <?php echo $days?> DAYS!</h3>
</div>
<input id="register-btn" type="button" class="btn btn-large btn-lg" title="Register" value="Register Here!" onclick="document.location='/register.php'">
<h4>Registrations <?php
if ($days > 7) {
echo "close in " . ($days - 7) . " day" . (($days - 7) == 1 ? "" : "s") . "!";
} else if ($days == 7) {
echo "close today! Hurry!";
} else {
echo "closed!";
}
?></h4>
</div>
<div class="admin-buttons"><form action="/admin"><input type="submit" class="btn btn-large btn-danger invisible" value="Admin Panel"/></form></div>
</div>
<div class="icons">
<a href="https://www.bbcanterbury.org.nz/"><img class="img-icon" src="img/logo-bb.png"></a>
<a href="http://site.iconz.org.nz/"><img class="img-icon" src="img/logo-iconz.png"></a>
</div>
<?php
/*if ($loggedIn) {
echo "<span class='administrate'>Admin Panel</span>";
} else {
debug("No session!");
}*/
?>
</body>
</html>