-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-panel.php
103 lines (97 loc) · 3.45 KB
/
admin-panel.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
<?php
require './includes/db.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Панель администратора</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<header class="header">
<div class="_container">
<div class="header__row">
<div class="header__btn header__btn_exit">
<a href="./logout.php" class="header__link" href="">Выход</a>
</div>
<div class="header__btn"><a class="header__link" href="./cabinet.php">Личный кабинет</a></div>
</div>
</div>
</header>
<div class="wrapper">
<div class="_container">
<div class="admin-panel">
<div class="admin-panel__row">
<?php
$users = R::findAll('users');/* Находим всех пользователей */
foreach ($users as $user) {/* и с помощью цикла выводим их данные */
?>
<div class="admin-panel__profile">
<div class="admin-panel__photo">
<div class="admin-panel__avatar">
<img src="./img/<?php echo $user['photo'] ?>" alt="" class="admin-panel__img">
</div>
</div>
<div class="admin-panel__info">
<div class="admin-panel__name">
<?php echo $user['surname'] . ' ' . $user['name'] . ' ' . $user['patronymic'] ?>
</div>
<div class="admin-panel__contacts">
<div class="admin-panel__title-contacts">Контакты:</div>
<ul class="admin-panel__list">
<li>
<a href="tel:<?php echo $user['number'] ?>" class="admin-panel__link"><?php echo $user['number'] ?></a>
</li>
<li>
<a href="mailto:<?php echo $user['email'] ?>" class="admin-panel__link"><?php echo $user['email'] ?></a>
</li>
</ul>
<form method="POST" action="./query.php" class="admin-panel__form">
<div class="adminpanel__controlers">
<select name="status" id="status" class="admin-panel__select">
<?php
if ($user['position'] == 'user') {
?>
<option value="user" selected>Пользователь</option>
<option value="admin">Администратор</option>
<?php
} else {
?>
<option value="user">Пользователь</option>
<option value="admin" selected>Администратор</option>
<?php
}
?>
</select>
<select name="condition" id="condition" class="admin-panel__select">
<?php
if ($user['status'] == 'acting') {
?>
<option value="acting" selected>Действующий</option>
<option value="block">Заблокированный</option>
<?php
} else {
?>
<option value="acting">Действующий</option>
<option value="block" selected>Заблокированный</option>
<?php
}
?>
</select>
</div>
<button class="admin-panel__subbmit btn" type="submit" name="btn" value="<?php echo $user['id'] ?>">Изменить статус пользователя</button>
</form>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</body>
</html>