-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminpage.php
119 lines (88 loc) · 3.92 KB
/
adminpage.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<title>UWEC Waterski and Wakeboard Team</title>
<link rel="stylesheet" href="css/style.css">
<link rel='stylesheet' type='text/css' media='screen' href='css/contact.css'>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito">
</head>
<body>
<header>
<h1 class="header">UW - Eau Claire: Waterski and Wakeboard Team</h1>
<div class="navbar">
<a class="navbar-link" href="index.html">Home</a>
<a class="navbar-link" href="practices.html">Practices</a>
<a class="navbar-link" href="tournaments.html">Tournaments</a>
<a class="navbar-link" href="executive.html">Executive Board</a>
<a class="navbar-link" href="gallery.html">Photo Gallery</a>
<a class="navbar-link" href="contact.html">Contact</a>
<a class="navbar-link" href="affiliations.html">Affiliations</a>
<a class="navbar-link" href="equipment.html">Equipment Use</a>
<a class="navbar-link" href="events.html">Social Events</a>
<a class="navbar-link" href="join.html">How to Join</a>
</div>
</header>
<div class="content">
<?php
// Get a connection for the database
// Defined as constants so that they can't be changed
DEFINE ('DB_USER', 'root');
DEFINE ('DB_PASSWORD', '');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'database_contact');
// $dbc will contain a resource link to the database
// @ keeps the error from showing in the browser
$dbc = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
OR die('Could not connect to MySQL: ' .mysqli_connect_error());
// Create a query for the database
$query = "SELECT Id, name, email, subject, message FROM submissions";
// Get a response from the database by sending the connection
// and the query
$response = @mysqli_query($dbc, $query);
// If the query executed properly proceed
if($response){
echo '<table align="center" cellspacing="5" cellpadding="8" style= border-radius: 10px;">
<tr >
<td align="center"><b>Id</b></td>
<td align="center"><b>Name</b></td>
<td align="center"><b>Email</b></td>
<td align="center"><b>Subject</b></td>
<td align="center"><b>Message</b></td>
</tr>';
// mysqli_fetch_array will return a row of data from the query
// until no further data is available
while($row = mysqli_fetch_array($response)){
echo '<tr><td align="center">' .
$row['Id'] . '</td><td align="center">' .
$row['name'] . '</td><td align="center">' .
$row['email'] . '</td><td align="center">' .
$row['subject'] . '</td><td align="center">' .
$row['message'] . '</td>';
echo '</tr>';
}
echo '</table>';
} else {
echo "Couldn't issue database query<br />";
echo mysqli_error($dbc);
}
// Close connection to the database
mysqli_close($dbc);
?>
<form action="delete_submission.php" method="post">
<h1><p align ='left'><u>SELECT ID TO DELETE</u></p></h1><br><br>
<h2><b>ID: </b><input type="text" name="id"><br><br>
<input type ="submit">
</h2>
</form>
</div>
<footer>
<div class="footer">
The Waterski and Wakeboard Team is a recognized Club Sports team at the University of Wisconsin - Eau Claire
</div>
</footer>
</body>
</html>