-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminpage.php
84 lines (55 loc) · 1.38 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
<?php
include "config.php";
// Check user login or not
if(!isset($_SESSION['uname'])){
header('Location: sign-in.php');
}
// logout
if(isset($_POST['but_logout'])){
session_destroy();
header('Location: sign-in.php');
}
// That shows all users of the database's table
$sql = "SELECT id, name, surname, username, age, sex, length, weight, body FROM AccountsRegister";
$result = $con->query($sql);
?>
<!doctype html>
<html>
<head>
<style>
.container {
margin-top: 80px;
}
.containersignin{
margin-bottom: 200px;
}
body {
background-color: pink;
}
img{
width: 170px;
height: 170px;
}
</style>
</head>
<body>
<center>
<h1>Welcome to Admin Page</h1>
<h3>Registered users appear below.</h3>
<?php
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
// Writing all information about reigstered users
echo "ID: ".$row['id']." Name: ".$row['name']." Surname: ".$row['surname']." Age: ".$row['age']." Sex: ".$row['sex']." Length: ".$row['length']." Weight: ".$row['weight']." Aim: ".$row['body']."<br>";
}
} else {
echo "0 results";
}
?>
<form method='post' action="">
<input type="submit" value="Logout" name="but_logout">
</form>
</center>
</body>
</html>