-
Notifications
You must be signed in to change notification settings - Fork 6
/
tables-data-banned-users.php
109 lines (101 loc) · 4.81 KB
/
tables-data-banned-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
<?php include('template-parts/header.php') ;?>
<?php include('template-parts/left-panel.php'); ?>
<div id="right-panel" class="right-panel">
<?php include('template-parts/top-bar.php'); ?>
<?php include('template-parts/breadcrumbs.php'); ?>
<div class="content mt-3">
<div class="animated fadeIn">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<strong class="card-title">User table</strong>
</div>
<div class="card-body">
<table id="bootstrap-data-table" class="table table-striped table-bordered">
<thead>
<tr>
<th>Steam name</th>
<th>reason</th>
<th>expire</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM ea_bans";
$result = $link->query($sql);
?>
<?php while($user = mysqli_fetch_object($result)): ?>
<?php
if($user->expire == '10444633200'){
$expire = 'Perma';
}else{
$expire = date('d-m-Y', $user->expire);
}
if( empty($user->steamname) ){
$name = explode("( Nickname: ",$user->reason);
$name = explode(" )",$name[1]);
$name = $name[0];
}else{
$name = $user->steamname;
}
?>
<tr>
<td><?=$name?></td>
<td><?=$user->reason?></td>
<td><?=$expire?> </td>
<td>
<a href="#" class="ban admin-action" data-banid="<?=$user->banid?>">Unban</a>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div><!-- .animated -->
</div><!-- .content -->
</div>
<script src="assets/js/vendor/jquery-2.1.4.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/lib/data-table/datatables.min.js"></script>
<script src="assets/js/lib/data-table/dataTables.bootstrap.min.js"></script>
<script src="assets/js/lib/data-table/dataTables.buttons.min.js"></script>
<script src="assets/js/lib/data-table/buttons.bootstrap.min.js"></script>
<script src="assets/js/lib/data-table/jszip.min.js"></script>
<script src="assets/js/lib/data-table/pdfmake.min.js"></script>
<script src="assets/js/lib/data-table/vfs_fonts.js"></script>
<script src="assets/js/lib/data-table/buttons.html5.min.js"></script>
<script src="assets/js/lib/data-table/buttons.print.min.js"></script>
<script src="assets/js/lib/data-table/buttons.colVis.min.js"></script>
<script src="assets/js/lib/data-table/datatables-init.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#bootstrap-data-table-export').DataTable();
jQuery(document).on("click", "a.ban",function(event) {
event.preventDefault;
if (confirm('Are you sure to unban?')) {
var banId = jQuery(this).data('banid');
jQuery.ajax({ //create an ajax request to display.php
type: "GET",
data: {
steamid: jQuery(this).data('steamid'),
banid: jQuery(this).data('banid'),
} ,
url: "/admin/actions/removeBan.php",
dataType: "html", //expect html to be returned
success: function(response){
jQuery('a.ban[data-banid="'+banId+'"]').parent().parent().hide(300);
}
}); // end ajax
} // end confirm
});
} );
</script>
</body>
</html>