-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.php
204 lines (183 loc) · 7.28 KB
/
users.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
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
<?php
include_once 'inc/database.php';
$database = new Connection();
$db = $database->openConnection();
?>
<!DOCTYPE html>
<html lang="en">
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Wallpapers | Users</title>
<!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon.png">
<!-- Custom Stylesheet -->
<link href="plugins/tables/css/datatable/dataTables.bootstrap4.min.css" rel="stylesheet">
<!-- Custom Stylesheet -->
<link href="plugins/sweetalert/css/sweetalert.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div id="loaderimg" style="display: none">
<img src="images/loader.gif" />
</div>
<!--*******************
Preloader start
********************-->
<div id="preloader">
<div class="loader">
<svg class="circular" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="3" stroke-miterlimit="10" />
</svg>
</div>
</div>
<!--*******************
Preloader end
********************-->
<!--**********************************
Main wrapper start
***********************************-->
<div id="main-wrapper">
<!--**********************************
Header start
***********************************-->
<?php include('inc/header.php'); ?>
<!--**********************************
Header end ti-comment-alt
***********************************-->
<!--**********************************
Sidebar start
***********************************-->
<?php include('inc/sidebar.php'); ?>
<!--**********************************
Sidebar end
***********************************-->
<!--**********************************
Content body start
***********************************-->
<div class="content-body">
<div class="row page-titles mx-0">
<div class="col p-md-0">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="home.php">Dashboard</a></li>
<li class="breadcrumb-item active"><a href="javascript:void(0)">Users</a></li>
</ol>
</div>
</div>
<!-- row -->
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div id="success-msg" class="alert alert-dismissible mt-3" style="display: none;">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Message!</strong> <span id="msg"></span>
</div>
<div class="card">
<div class="card-body">
<h4 class="card-title">All Users</h4>
<div class="table-responsive" id="table-display">
<?php include('inc/users_table.php'); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- #/ container -->
</div>
<!--**********************************
Content body end
***********************************-->
<!--**********************************
Footer start
***********************************-->
<?php include('inc/footer.php'); ?>
<!--**********************************
Footer end
***********************************-->
</div>
<!--**********************************
Main wrapper end
***********************************-->
<!--**********************************
Scripts
***********************************-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="plugins/common/common.min.js"></script>
<script src="js/custom.min.js"></script>
<script src="js/settings.js"></script>
<script src="js/gleek.js"></script>
<script src="js/styleSwitcher.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.2/jquery.form.js"></script>
<script src="plugins/tables/js/jquery.dataTables.min.js"></script>
<script src="plugins/tables/js/datatable/dataTables.bootstrap4.min.js"></script>
<script src="plugins/tables/js/datatable-init/datatable-basic.min.js"></script>
<script src="plugins/sweetalert/js/sweetalert.min.js"></script>
<script src="plugins/sweetalert/js/sweetalert.init.js"></script>
<script type="text/javascript">
function UsersTable() {
$.ajax({
url:'inc/users_table.php',
method:'POST',
success:function(data){
$('#table-display').html(data);
$('#table-category').DataTable();
}
});
}
function DeleteData(id) {
swal({
title: "Are you sure?",
text: "Disable all related products when you delete this category. Do you want to delete this category?",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, delete it!",
cancelButtonText: "No, cancel plz!",
closeOnConfirm: false,
closeOnCancel: false,
showLoaderOnConfirm: true,
},
function(isConfirm) {
if (isConfirm) {
var url='ajax/user.php';
$.ajax({
url: url,
data: {
action: 'delete',
id: id
},
method: 'POST',
success: function(response) {
swal({
title: "Approved!",
text: "User has been deleted.",
type: "success",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Ok",
closeOnConfirm: false,
showLoaderOnConfirm: true,
},
function(isConfirm) {
if (isConfirm) {
$('#dataid'+id).remove();
swal.close();
// location.reload();
}
});
},
error: function(e) {
swal("Cancelled", "Something Went Wrong :(", "error");
}
});
} else {
swal("Cancelled", "Your record is safe :)", "error");
}
});
}
</script>
</body>
</html>