forked from sacosta1369/COSC386Recycling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·144 lines (115 loc) · 5.06 KB
/
index.php
File metadata and controls
executable file
·144 lines (115 loc) · 5.06 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
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
<DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name"viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="pageStyle.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Sora:wght@800&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@700&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<title>Recycling Database Interface</title>
</head>
<body>
<!-- Menu bar at top of page -->
<div id="menu">
<!-- Lower Eastern Shore Recycling Logo -->
<div id="logo" class="LogoClass">
</div>
<!-- Recycling dropdown menu -->
<div id="recycle" class="menuBox"><span>Recycle ▼</span>
</div>
<!-- Search tab -->
<div id="search" class = "menuBox"><span>Search</span>
</div>
<!-- Log in tab -->
<div id="admin" class = "menuBox">
<span>Log In</span> <img src="LogIn.png" alt="A log-in logo" id="login" class="menuImage" id="logImg">
<script type="text/javascript">
document.getElementById("admin").onclick = function() {
window.location.replace("login.php");
};
document.getElementById("logo").onclick = function() {
window.location.replace("index.php");
};
document.getElementById("search").onclick = function() {
let e = document.getElementById("searchbar");
e.scrollIntoView({
block: 'center',
behavior: 'smooth',
inline: 'center'
});
};
$(document).ready(function() {
$('.menuBox').mousedown(function(e) {
$(this).css("color", "#000000");
});
});
$(document).ready(function() {
$('.menuBox').mouseup(function(e) {
$(this).css("color", "#EDF5E1");
});
});
</script>
</div>
<!-- Contact info tab -->
<div id="contact" class = "menuBox"><span>Contact</span>
<img src="ContactInfo.png" alt="A contact logo" id="contactinfo" class="menuImage">
</div>
</div>
<!--
<form method=post legend="Database query" action="SearchScript.php">
<input type="text" name="search" id="searchInput" placeholder="Enter your search here:">
<input type="submit" id="submitSearch" value="🔍">
</form>
-->
<div id="textDescription">
<h1 id="headerText">Welcome to the Maryland TriCounty Recycling Database Interface</h1>
</div>
<form id="searchbar">
<input type="text" name="search" class="roundedBar">
<input type="submit" class="sub" value="" id="submitsearch">
</form>
<?php
if ($connection=@mysqli_connect('localhost', 'jcomfort1', 'Waypointer2022', 'RecyclingDB'))
{
print '<p id="confirm">Successfully connected to MySQL. </p>';
}
$searchVal = $_POST['search'];
$query = "SELECT * FROM Department";
echo "<div id='phpDiv'>";
$result = mysqli_query($connection, $query);
echo "<table border = '1'>
<thead>
<tr>
<th> Department Name </th>
<th> Contact Info </th>
<th> Office Address </th>
<th> Office Hours </th>
</tr>
</thead>";
while($row=mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['DepartmentName'] . "</td>";
echo "<td>" . $row['ContactInfo'] . "</td>";
echo "<td>" . $row['OfficeAddress'] . "</td>";
echo "<td>" . $row['OfficeHours'] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "</div>";
mysqli_close($connection);
?>
<!--
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d525405.9172451661!2d-75.85674549345423!3d38.34305026752715!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89b9aa4972679671%3A0xa1851f209ca0e3ae!2sWicomico%20County%2C%20MD!5e0!3m2!1sen!2sus!4v1648993091737!5m2!1sen!2sus" style="border:3px solid black;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade" id="LandingMap"></iframe>
-->
</body>
</html>