-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
123 lines (102 loc) · 2.96 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
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
<?php
session_start();
$cookieLifetime = 365 * 24 * 60 * 60; // A year in seconds
setcookie(session_name(),session_id(),time()+$cookieLifetime);
if ( isset($_POST['ipadnumber']) ) {
$inumber = $_POST['ipadnumber'] + 0;
$_SESSION['ipadnumber'] = $inumber;
$_SESSION['previous'] = $inumber;
if ( $inumber < 0 ) {
unset($_SESSION['ipadnumber']);
} else if ( $inumber == 0) {
unset($_SESSION['ipadnumber']);
}
header("Location: ./#ipadinfo");
return;
}
$inumber = isset($_SESSION['ipadnumber']) ? $_SESSION['ipadnumber'] : '';
$inum = isset($_SESSION['previous']) ? $_SESSION['previous'] : '';
unset($_SESSION['ipadnumber']);
?>
<!DOCTYPE HTML>
<!--
Twenty by HTML5 UP
html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<!--HEAD-->
<?php
include "head.php"
?>
<body class="index">
<header id="header" class="alt">
<?php
include "navigation.php";
?>
</header>
<!-- Banner -->
<section id="banner">
<article >
<!--
".inner" is set up as an inline-block so it automatically expands
in both directions to fit whatever's inside it. This means it won't
automatically wrap lines, so be sure to use line breaks where
appropriate (<br />).
-->
<!--Student Search-->
<p><div id="completesearch">
<form onSubmit="return false;" method="post" id="searchform">
<input type="standard" name="search" id="searchbox" autocomplete="off" placeholder="Search Students" onkeyup="searchq();" onfocus="this.select()" />
</form>
<div id="output"></div>
</div>
</p>
</br>
<div class="inner">
<p><strong>Find iPad Assignment</strong></p>
<header>
<form name="numlookup" method="post">
<?php
echo '<h2><input placeholder="iPad #" onclick="this.select();" type="number" value="'."$inum".'" pattern="[0-9]*" min="0" maxlength="3" name="ipadnumber" size="40" required></h2>';
unset($_SESSION['previous']);
?>
</header>
<p>Please enter
<br>iPad #</br></p>
<footer>
<input type="submit" value="Search iPad"/></form>
</footer>
</div>
</section>
<!-- Ipadinfo -->
<?php
if ($inumber !== '' ) {
include "info.php";
}
?>
<?php
if (isset($_SESSION['account'])){
if ($_SESSION['account'] === "admin") {
echo '
<!-- CTA -->
<section id="cta">
<header>
<h2>Need to change <strong>something</strong>?</h2>
<p>Add new or update existing entries.</p>
</header>
<footer>
<ul class="buttons">
<li><a href="#" class="button">ipads</a></li>
<li><a href="#" class="button">Students</a></li>
</ul>
</footer>
</section>
';}}
?>
</article>
<?php
include "footer.php";
?>
</body>
</html>