-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.php
More file actions
232 lines (193 loc) · 7.24 KB
/
users.php
File metadata and controls
232 lines (193 loc) · 7.24 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
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<?php
session_start();
$login = false;
//am I even logged in? if not, send me to the loginpage
if (!isset($_SESSION['user']) ||
$_SESSION['admin_flag'] != '1'
) {
header("Location: login.php");
// Is user logged in?
}
/** @var $db mysqli */
require_once 'connection/connection.php';
$query = "SELECT * FROM users";
$result = mysqli_query($db, $query)
or exit('Error ' . mysqli_error($db) . ' with query ' . $query);
$users = [];
while ($row = mysqli_fetch_assoc($result)) {
$users[] = $row;
}
$number = '';
mysqli_close($db);
?>
<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>AdminPagina</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css"
>
<link rel="stylesheet" href="CSS/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.cdnfonts.com/css/imagination-station" rel="stylesheet">
<link href="https://fonts.cdnfonts.com/css/open-sans" rel="stylesheet">
</head>
<body>
<nav class="navbar has-background-info" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item">
<figure class="image is-32x32">
<a href="homepage.php" target="_self"><img class="is-rounded" src="Images/BroersLogo.png"
alt="Logo"/></a>
</figure>
</a>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="nav-bar">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<script>
document.addEventListener('DOMContentLoaded', () => {
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
$navbarBurgers.forEach(el => {
el.addEventListener('click', () => {
const target = el.dataset.target;
const $target = document.getElementById(target);
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
});
</script>
</a>
</div>
<div class="navbar-menu" id="nav-bar">
<div class="navbar-end">
<a href="menu.php" class="navbar-item is-link">
Ons Menu
</a>
<a href="reserveringen.php" class="navbar-item is-link">
Reserveer
</a>
<a href="contact.php" class="navbar-item is-link">
Contact
</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link">
Meer
</a>
<div class="navbar-dropdown">
<a href="aanbod.php" class="navbar-item">
Ons Aanbod
</a>
<a href="evenementen.php" class="navbar-item">
Onze Evenementen
</a>
<a href="arrangementen.php" class="navbar-item">
Onze Arrangementen
</a>
<a href="reviewspage.php" class="navbar-item">
Reviews
</a>
</div>
</div>
</div>
<?php if (empty($_SESSION)) : ?>
<div class="buttons">
<a href="login.php" class="button is-primary is-outlined">
Log In
</a>
</div>
<?php elseif (isset($_SESSION['admin_flag'])): ?>
<?php if ($_SESSION['admin_flag'] == 1): ?>
<div class="buttons">
<a href="admin.php" class="button is-primary is-outlined">
Admin
</a>
</div>
<?php endif; ?>
<?php else: ?>
<div class="buttons">
<a href="logout.php" class="button is-link is-outlined">
Log Out
</a>
</div>
<?php endif; ?>
</div>
</nav>
<main>
<section class="footerPadding">
<table class="table table is-striped is-hoverable mx-auto" action="" method="post">
<div class="left">
<thead>
<tr>
<td>#</td>
<td>Name</td>
<td>E-mail</td>
<td>Telefoonnummer</td>
<td>Admin</td>
</tr>
</thead>
<tbody>
<?php foreach ($users as $number => $user) { ?>
<tr>
<td><?= $number + 1 ?> </td>
<td> <?= $user['name'] ?> </td>
<td> <?= $user['email'] ?> </td>
<td> <?= $user['phonenumber'] ?></td>
<td> <?= $user['admin_flag'] ?></td>
<td><a href="editusers.php">Edit</a></td>
<td><a href="deleteusers.php?id=<?= $user['id'] ?>">Delete</a></td>
</tr>
<?php } ?>
</tbody>
</div>
</table>
</section>
<style>
.footerPadding {
padding-bottom: 500px;
}
</style>
</main>
<footer class="has-background-info">
<div class="footerRow">
<div><p>Follow Us!</p>
<a href="https://www.instagram.com/broers.ridderkerk">
<i class="fa fa-instagram" style="font-size:30px"></i>
</a>
<a href="https://www.facebook.com/profile.php?id=61562490741128">
<i class="fa fa-facebook-square" style="font-size:30px"></i>
</a>
</div>
<div>
<div class="openingstijdenOnder"><h3>Openingstijden</h3>
<div class="openingstijdenSamen">
<div class="openingstijden"><p>Woensdag</p>
<p>Donderdag</p>
<p>Vrijdag</p>
<p>Zaterdag</p>
<p>Zondag</p></div>
<div class="openingstijden"><p>11:00-23:00</p>
<p>11:00-23:00</p>
<p>11:00-23:00</p>
<p>11:00-23:00</p>
<p>12:00-22:00</p></div>
</div>
</div>
</div>
<div class="detailsFooter"><img class="broersLogo" src="Images/BroersLogo.png" alt="logo">
<p>Eetcafé BROERS</p>
<p>Koningsplein 44</p>
<p>2981 EA Ridderkerk</p>
<p>info@broersridderkerk.nl</p>
<p>06 - 48 18 54 03</p></div>
</div>
</footer>
</body>
</html>