-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
60 lines (52 loc) · 1.8 KB
/
header.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
<?php
session_start();
echo "<!DOCTYPE html>\n<html><head><script src='javascript.js' type='text/javascript'></script>".
"<script>function setVisible(){
if (navigator.cookieEnabled === true){
S('container2').visibility = 'visible';
S('container1').visibility = 'visible';
}
else{
O('bod').innerHTML = '<h1> Enable cookies to see the website</h1>';
}
}
</script>".
"<noscript><h1>Please enable JavaScript if you want to access the page</h1></noscript>";
require_once 'functions.php';
$emailstr = 'Guest (To reserve seat please log in) ';
if (isset($_SESSION['email']))
{
if(!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != "on"){
header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"], true, 301);
exit;
}
$email = $_SESSION['email'];
$loggedin = TRUE;
$emailstr = " ($email)";
checkInactivity();
}
else $loggedin = FALSE;
echo <<<_HEAD
<title>$appname$emailstr</title><link rel='stylesheet'
href='styles.css' type='text/css'></head>
<body id='bod' onload="setVisible()">
<div id='container1' class='appname'>$appname
<h3>User: $emailstr</h3>
</div><div id='container2'> <div class = 'left'>
_HEAD;
if ($loggedin)
{
echo( "<ul class='menu'>" .
"<li><a href='index.php'>Home</a></li>".
'<li><a style="cursor: pointer;" onclick="buySeats()">Buy</a></li>'.
"<li><a href='index.php'>Refresh</a></li>".
"<li><a href='logout.php'>Logout</a></li></ul></div>" );
}
else
{
echo ("<ul class='menu'>" .
"<li><a href='index.php'>Home</a></li>".
"<li><a href='signup.php'>Sign up</a></li>" .
"<li><a href='login.php'>Log in</a></li></ul></div>" );
}
?>