-
Notifications
You must be signed in to change notification settings - Fork 0
/
nav3.php
217 lines (194 loc) · 11.1 KB
/
nav3.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<head>
<link rel="icon" href="img/ogiebooks.png">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Introducing Lollipop, a sweet new take on ogiebooks.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>ogiebooks</title>
<!-- Page styles -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="css/material.css">
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/mdl-selectfield.min.css">
<style>
#view-source {
position: fixed;
display: block;
right: 0;
bottom: 0;
margin-right: 40px;
margin-bottom: 40px;
z-index: 900;
}
_:-moz-tree-row(hover), .ogiebooks-search-box {
top: 4px;
}
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.ogiebooks-search-box {
top: 3.5px;
}
}
</style>
</head>
<?php
unset($errormsg);
$fn = basename($_SERVER['PHP_SELF']);
if(isset($_SESSION['usr_id'])!="") {
$timeouttime = time() - $_SESSION['timeout'];
if(!empty($_SESSION['stayloggedin'])) {
if($_SESSION['stayloggedin'] < time()) {
session_destroy(); unset($_SESSION['usr_id']); unset($_SESSION['usr_name']); unset($_SESSION['stayloggedin']); header("Location: index.php");
}
} else {
if ($timeouttime > 1800) {
session_destroy(); unset($_SESSION['usr_id']); unset($_SESSION['usr_name']); header("Location: index.php");
}else {
$_SESSION['timeout'] = time();
}
}
}
if (isset($_SESSION['previous']) && isset($_SESSION['previous2'])) {
if (basename($_SERVER['PHP_SELF']) != $_SESSION['previous'] && basename($_SERVER['PHP_SELF']) != $_SESSION['previous2'] ) {
session_destroy();
### or alternatively, you can use this for specific variables:
### unset($_SESSION['varname']);
}
}
if (isset($_SESSION['previous3'])) {
if (basename($_SERVER['PHP_SELF']) != $_SESSION['previous3']) {
unset($_SESSION['email2']);
### or alternatively, you can use this for specific variables:
### unset($_SESSION['varname']);
}
}
if (isset($_SESSION['previous4'])) {
if (basename($_SERVER['PHP_SELF']) != $_SESSION['previous4'] OR time() - $_SESSION['created'] > 5) {
unset($_SESSION['error_info']);
### or alternatively, you can use this for specific variables:
### unset($_SESSION['varname']);
}
}
?>
<style type="text/css">
input {
height: 100%;
}
.form-check-input:only-child {
position: absolute;
}
</style>
<body>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header mdl-layout--fixed-tabs">
<div class="ogiebooks-header mdl-layout__header">
<div class="mdl-layout__header-row">
<span class="ogiebooks-title mdl-layout-title">
<a href="index.php">
<img class="ogiebooks-logo-image" src="icon/ogiebooks.png">
</a>
</span>
<!-- Add spacer, to align navigation to the right in desktop -->
<div class="ogiebooks-header-spacer mdl-layout-spacer"></div>
<div class="ogiebooks-search-box mdl-textfield mdl-js-textfield mdl-textfield--expandable mdl-textfield--floating-label mdl-textfield--align-right mdl-textfield--full-width">
<form action="search.php" method="GET">
<label class="mdl-button mdl-js-button mdl-button--icon" for="search-field">
<i class="material-icons">search</i>
</label>
<div class="mdl-textfield__expandable-holder">
<input name="search_value" class="mdl-textfield__input" type="text" id="search-field">
</div>
</form>
</div>
<!-- Navigation -->
<div class="ogiebooks-navigation-container">
<nav class="ogiebooks-navigation mdl-navigation">
<a <?php echo ($page == 'index.php') ? "class='mdl-navigation__link mdl-navigation__link-active mdl-typography--text-uppercase active' href='#'" : ""; ?> class="mdl-navigation__link mdl-typography--text-uppercase active" href="index.php">Home</a>
<a <?php echo ($page == 'booklist.php') ? "class='mdl-navigation__link mdl-navigation__link-active mdl-typography--text-uppercase active' href='#'" : ""; ?> class="mdl-navigation__link mdl-typography--text-uppercase" href="booklist.php">Book List</a>
<a <?php echo ($page == 'filterbooks.php' OR $page == 'filterresults.php') ? "class='mdl-navigation__link mdl-navigation__link-active mdl-typography--text-uppercase active' href='#'" : ""; ?> class="mdl-navigation__link mdl-typography--text-uppercase" href="filterbooks.php">Find Specific Book</a>
<a <?php echo ($page == 'watchlist.php' OR $page == 'watchlistresults.php' OR $page == 'watchlistadd.php') ? "class='mdl-navigation__link mdl-navigation__link-active mdl-typography--text-uppercase active' href='#'" : ""; ?> class="mdl-navigation__link mdl-typography--text-uppercase" href="watchlist.php">Watchlist</a>
<a <?php echo ($page == 'selectbooks.php' OR $page == 'submitbooks.php') ? "class='mdl-navigation__link mdl-navigation__link-active mdl-typography--text-uppercase active' href='#'" : ""; ?> class="mdl-navigation__link mdl-typography--text-uppercase" href="selectbooks.php">Post An Ad</a>
</nav>
</div>
<span class="ogiebooks-mobile-title mdl-layout-title">
<img class="ogiebooks-logo-image" src="icon/ogiebooks.png">
</span>
<button class="ogiebooks-more-button mdl-button mdl-js-button mdl-button--icon mdl-js-ripple-effect" id="more-button">
<i class="material-icons">more_vert</i>
</button>
<ul class="mdl-menu mdl-js-menu mdl-menu--bottom-right mdl-js-ripple-effect" for="more-button">
<li class="mdl-menu__item">About Us</li>
<li class="mdl-menu__item">FAQ</li>
<li class="mdl-menu__item">Contact Us</li>
<li <?php echo ($page == 'updateemail.php') ? "class='mdl-menu__item' onclick='#'" : ""; ?> class="mdl-menu__item" onclick="window.location='updateemail.php'">Update Email & Info</li>
</ul>
<button class="ogiebooks-account-button ogiebooks-more-button mdl-button mdl-js-button mdl-button--icon mdl-js-ripple-effect" id="account-button" style=" display: block !important;">
<?php if (isset($_SESSION['usr_id']) ) { ?>
<i class="material-icons" style="color: green !important;">account_circle</i>
<?php } else { ?>
<i class="material-icons">account_circle</i>
<?php } ?>
</button>
<ul class="mdl-menu mdl-js-menu mdl-menu--bottom-right mdl-js-ripple-effect" for="account-button">
<?php if (isset($_SESSION['usr_id']) ) { ?>
<li disabled class="mdl-menu__item">Signed In as <?php echo $_SESSION['usr_name']; ?></li>
<li class="mdl-menu__item" onclick="window.location='logout.php'">Sign Out</li>
<?php } elseif($fn == 'login.php' AND $fn !== 'register.php' AND $fn !== 'dob.php') { ?>
<li <?php echo ($page == 'login.php') ? "class='mdl-menu__item' onclick='#'" : ""; ?> class="mdl-menu__item">Login</li>
<li class="mdl-menu__item" onclick="window.location='dob.php'">Sign Up</li>
<?php } else { ?>
<li class="mdl-menu__item" onclick="window.location='login.php'">Login</li>
<li <?php echo ($page == 'register.php' OR $page == 'dob.php') ? "class='mdl-menu__item' onclick='#'" : ""; ?> class="mdl-menu__item" onclick="window.location='dob.php'">Sign Up</li>
<?php } ?>
</ul>
</div>
<!-- Tabs -->
<!-- Tabs -->
<div class="mdl-layout__tab-bar mdl-js-ripple-effect" >
<a <?php echo ($page == 'selectbooks.php') ? "class='mdl-layout__tab is-active' href='#'" : ""; ?> href="selectbooks.php" class="mdl-layout__tab">First Step</a>
<a <?php echo ($page == 'submitbooks.php') ? "class='mdl-layout__tab is-active' href='#'" : ""; ?> <?php echo (empty($_SESSION['key2'])) ? "href='#' id='demo-show-snackbar'" : ""; ?> href="submitbooks.php" class="mdl-layout__tab">Second Step</a>
</div>
</div>
<div class="ogiebooks-drawer mdl-layout__drawer" >
<span class="mdl-layout-title" style="line-height: 1em !important">
<i class="material-icons" style="padding-top: 3em;">account_circle</i>
<br></br>
<span><?php if(isset($_SESSION['usr_name'])) { echo $_SESSION['usr_name']; } else { echo 'Login'; } ?></span>
</span>
<nav class="mdl-navigation">
<a <?php echo ($page == 'index.php') ? "class='mdl-navigation__link mdl-navigation__link-active' href='#'" : ""; ?> class="mdl-navigation__link" href="index.php">Home</a>
<a <?php echo ($page == 'booklist.php') ? "class='mdl-navigation__link mdl-navigation__link-active' href='#'" : ""; ?> class="mdl-navigation__link" href="booklist.php">Book List</a>
<a <?php echo ($page == 'filterbooks.php' OR $page == 'filterresults.php') ? "class='mdl-navigation__link mdl-navigation__link-active' href='#'" : ""; ?> class="mdl-navigation__link" href="filterbooks.php">Find Specific Book</a>
<a <?php echo ($page == 'watchlist.php' OR $page == 'watchlistresults.php' OR $page == 'watchlistadd.php') ? "class='mdl-navigation__link mdl-navigation__link-active' href='#'" : ""; ?> class="mdl-navigation__link" href="watchlist.php">Watchlist</a>
<a <?php echo ($page == 'selectbooks.php' OR $page == 'submitbooks.php') ? "class='mdl-navigation__link mdl-navigation__link-active' href='#'" : ""; ?> class="mdl-navigation__link" href="selectbooks.php">Post an Ad</a>
<div class="ogiebooks-drawer-separator"></div>
<span class="mdl-navigation__link" href="">More</span>
<a class="mdl-navigation__link" href="">About Us</a>
<a class="mdl-navigation__link" href="">FAQ</a>
<a class="mdl-navigation__link" href="">Contact Us</a>
<a class="mdl-navigation__link" href="">Update Email & Info</a>
</nav>
</div>
<?php if (empty($_SESSION['key2'])) { ?>
<div id="demo-snackbar-example" class="mdl-js-snackbar mdl-snackbar">
<div class="mdl-snackbar__text" style="margin-right: 11px"></div>
<button class="mdl-snackbar__action" style="display:none" type="button"></button>
</div>
<?php } ?>
<script>
(function() {
'use strict';
var snackbarContainer = document.querySelector('#demo-snackbar-example');
var showSnackbarButton = document.querySelector('#demo-show-snackbar');
var handler = function(event) {
showSnackbarButton.style.backgroundColor = '';
};
showSnackbarButton.addEventListener('click', function() {
'use strict';
var data = {
message: 'Please select your books before continuing.',
timeout: 5000,
};
snackbarContainer.MaterialSnackbar.showSnackbar(data);
});
}());
</script>