-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminpanel.php
More file actions
100 lines (91 loc) · 4.14 KB
/
adminpanel.php
File metadata and controls
100 lines (91 loc) · 4.14 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
<?php
include 'dbh.php';
?>
<html>
<head>
<meta charset="UTF-8">
<title>Adminpanel</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<fieldset>
<legend>Admin Panel</legend>
<br>
<fieldset class="fieldset1">
<legend>Fächer</legend>
<fieldset class="fieldset2">
<legend>vorhandene Fächer</legend>
<div class="div1">
<table>
<?php
$sql = "SELECT name FROM subject";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()){
echo "
<tr>
<td>".$row['name']."</td>
<td>
<form method='post' action='subject_delete.php'>
<button name='subject' type='submit' value=".$row['name'].">X</button>
</form>
</td>
</tr>";
}
} else {
echo "keine Fächer";
}
?>
</table>
</div>
</fieldset>
<fieldset class="fieldset2">
<legend>Fach hinzufügen</legend>
<div class="div1">
<form action="input_subject.php" method="POST">
<input class="first" type="text" name="subject" placeholder="Fach">
<input class="first" type="submit" name="Submit">
</form>
</div>
</fieldset>
</fieldset>
<fieldset class="fieldset1">
<legend>Benutzer verwalten</legend>
<fieldset class="fieldset2">
<legend>Benutzer entfernen</legend>
<table>
<tr>
<td>username</td>
<td>password</td>
<td>permission</td>
<td></td>
</tr>
<?php
$sql = "SELECT * FROM users";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()){
echo "
<tr>
<td>".$row['username']."</td>
<td>".$row['pwd']."</td>
<td>".$row['permission']."</td>
<td>
<form method='post' action='user_delete.php'>
<button name='username' type='submit' value=".$row['username'].">X</button>
</form>
</td>
</tr>";
}
}
?>
</table>
</fieldset>
<fieldset class="fieldset2">
<legend>Benutzer hinzufügen</legend>
</fieldset>
</fieldset>
</fieldset>
</body>
</html>
<!-- Nigglas -->