-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
81 lines (79 loc) · 3.01 KB
/
index.php
File metadata and controls
81 lines (79 loc) · 3.01 KB
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
<html>
<head>
<title>FAHS Flex</title>
<link rel="stylesheet" href="css/style.css">
<link rel="apple-touch-icon" href="/faflexappicon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="icon" href="favicon.ico">
<meta name="google-signin-client_id" content="483422839968-llldr1bas7hurg44av8h9bh8dpqgtq98.apps.googleusercontent.com">
<script src="https://apis.google.com/js/platform.js" async defer></script>
</head>
<body>
<div class="topnav">
<a href="index.php"><img id="logo" src="faflexlogo.svg"></a>
<a id="schedulebutton" class="disable-select">My Schedule</a>
<a id="signupbutton" href="index.php" class="disable-select">Sign Up</a>
</div>
<script type="text/javascript" src="scripts/script.js"></script>
<p id="searchtxt">Type in a teacher below to sign up for flex.</p>
<input id="searchbar" type="text" onkeyup="searchFilter1()" placeholder="Search for a teacher...">
<table id="teachertable" border=1>
<?php
include "scripts/schedule.php";
include "scripts/adminConstants.php";
$query = "SHOW TABLES FROM franklin_flexSystem";
if(!$result = mysqli_query($connect, $query)) {
echo "Failed to obtain tables..." . mysqli_error($connect);
} else {
$counter = 0;
while($tables = mysqli_fetch_array($result)) {
$data = getTableData($tables[0], 0, $connect);
if($data["type"] != null && ($data["type"] == "teacher" || $data["type"] == "floater")) {
$name = $data["name"];
if($counter == 0) echo "<tr>";
else if($counter%4 == 0) echo "</tr><tr>";
echo "<td style='padding: 10px;' id='$name' onclick='teacherclick(this);'>$name</td>";
$counter++;
}
}
echo "</tr>";
}
?>
</table>
<table id="teachertablehidden" style="display: none" border=1>
<?php
$query = "SHOW TABLES FROM franklin_flexSystem";
if(!$result = mysqli_query($connect, $query)) {
echo "Failed to obtain tables..." . mysqli_error($connect);
} else {
$counter = 0;
while($tables = mysqli_fetch_array($result)) {
$data = getTableData($tables[0], 0, $connect);
if($data["type"] != null && $data["type"] == "teacher") {
$name = $data["name"];
if($counter == 0) echo "<tr>";
else if($counter%4 == 0) echo "</tr><tr>";
echo "<td style='padding: 10px;' id='$name' onclick='teacherclick(this);'>$name</td>";
$counter++;
}
}
echo "</tr>";
}
?>
</table>
<script type="text/javascript" src="scripts/signin.js"></script>
<script type="text/javascript" src="scripts/schedule.js"></script>
<script type="text/javascript" src="scripts/linkSchedulePHP.js"></script>
<div class="g-signin2" data-onsuccess="onSignIn" data-onfailure="askForLogin" data-theme="dark" style="visibility: hidden;"></div>
<a href="#" style="position: absolute; top:80px; right: 10px;" onclick="logout();">Sign out</a>
<div id="footerSpace"></div>
<footer>
<div class="foot">
© 2019 Jordan Martin and Grant Gupton
<br/>
Class of 2020
</div>
</footer>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</body>
</html>