-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminbin.php
More file actions
175 lines (158 loc) · 7.59 KB
/
adminbin.php
File metadata and controls
175 lines (158 loc) · 7.59 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
<?php
include_once "./assets/php/config.php";
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['user_deleted'])) {
$user_deleted = mysqli_real_escape_string($conn, $_POST['user_deleted']);
$sql = mysqli_query($conn, "SELECT * FROM userinformation WHERE ID = '{$user_deleted}'");
if (mysqli_num_rows($sql) > 0) {
$row = mysqli_fetch_assoc($sql);
$user_id = $row["ID"];
// Thêm vào bảng bin
$check_bin = mysqli_query($conn, "SELECT * FROM bin WHERE UserID = '{$user_id}'");
if (mysqli_num_rows($check_bin) == 0) {
// Nếu chưa tồn tại, thêm vào bảng bin
$insert_query = mysqli_query($conn, "INSERT INTO bin(UserID) VALUES ({$user_id})");
}
}
// Chuyển hướng sau khi xử lý thành công
header("Location: adminbin.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Bin</title>
<!-- Reset -->
<link rel="stylesheet" href="./assets/css/reset.css">
<!-- fonts -->
<link rel="stylesheet" href="./assets/fonts/stylesheet.css">
<!-- AdminPage css -->
<link rel="stylesheet" href="./assets/css/adminbin.css">
</head>
<body>
<div class="container">
<!-- wrap nav -->
<aside class="aside">
<!-- Logo -->
<div class="logo">
<img src="./assets/img/logo.svg" alt="Flirt Zone">
<div class="logo-desc">
<img src="./assets/img/logo-desc1.svg" alt="Flirt Zone">
<img src="./assets/img/logo-desc2.svg" alt="Flirt Zone">
</div>
</div>
<!-- Mangage -->
<h2 class="title">Manage</h2>
<!-- nav -->
<nav class="nav">
<div class="nav-item">
<div class="icon">
<img src="./assets/icons/taskAdmin1.svg" alt="Dash board">
</div>
<p><a class="task" style="text-decoration: none;" href="adminpage.php">Dash board</a></p>
</div>
<div class="nav-item">
<div class="icon">
<img src="./assets/icons/taskAdmin2.svg" alt="User profile">
</div>
<p><a class="task" style="text-decoration: none;" href="adminprofileuser.php">User
profile</a></p>
</div>
<div class="nav-item">
<div class="icon">
<img src="./assets/icons/taskAdmin3.svg" alt="Bin">
</div>
<p><a class="task" style="text-decoration: none;" href="adminbin.php">Bin</a></p>
</div>
</nav>
</aside>
<!-- wrap content -->
<div class="wrap">
<!-- Header -->
<header class="header">
<div class="title-intro">
<h1 class="title">Hey there!😘</h1>
<p class="desc">Here’s what happen your stored today</p>
</div>
<form class="bar-search">
<input type="text" size="31" placeholder="what are you looking for?" class="looking" id="word"
name="word">
<button>
<img src="./assets/icons/search.svg" alt="Search" class="icon-search">
</button>
</form>
</header>
<div class="wrap-content">
<div class="bin__content-head">
<div class="bin__firstcontent">UserName</div>
<div class="bin__secondcontent">Follow</div>
<div class="bin__thirdcontent">Delete Date</div>
<div class="bin__fourthcontent">Restore</div>
</div>
<div class="bin__content-box">
<?php
$bin_un="
select userinformation.ID,userinformation.UserName,userinformation.BirthDate
from bin
inner join userinformation ON bin.UserID = userinformation.ID
";
$bin_date ="select DATE(NOW()) AS currentDate";
$kq1 = mysqli_query($conn,$bin_un);
$kq2 = mysqli_query($conn,$bin_date);
$currentDate = "";
if ($row = mysqli_fetch_assoc($kq2)) {
$currentDate = $row['currentDate'];
}
$ad_fl="select * from followers";
$kq_ad_fl = mysqli_query($conn,$ad_fl);
$listfollowers = [];
while($row = mysqli_fetch_array($kq_ad_fl)) {
$listfollowers[] = $row;
}
?>
<?php
while ($a = mysqli_fetch_array($kq1))
{
?>
<div class="bin__content-body">
<div class="content-body__user">
<div class="chatavt button avatar" style="background-image: url(./assets/img/avt.jpg);">
</div>
<div class="content-body__user-N-BD">
<div class="content-body__user-Name"><?php echo $a["UserName"]?></div>
<div class="content-body__user-BirthDate"><?php echo $a["BirthDate"]?></div>
</div>
</div>
<div class="content-body__followers">
<div class="followers-num">
<?php
$fl_count = 0;
foreach($listfollowers as $b) {
if ($b["FollowerID"] == $a["ID"] ) {
$fl_count += 1;
}
}
echo $fl_count;
?>
</div>
<div class="followers-text">Followers</div>
</div>
<div class="content-body__deletedate">
<div class="DeleteDate"><?php echo $currentDate ?></div>
</div>
<div class="content-body__restore">
<a href="user-profile-2-admin-page.php" class="profile-button btn-icon"
style="background-color: blue; background-image: url(./assets/img/user_white.png)"></a>
<a href="#!" class="chat-button btn-icon"
style="background-color: yellow; background-image: url(./assets/img/restore.png);"></a>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</body>
</html>