-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
executable file
·77 lines (76 loc) · 3.54 KB
/
admin.php
File metadata and controls
executable file
·77 lines (76 loc) · 3.54 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
<?php
include('adminheader.php');
$query = new Query;
$numClans = $query->clansByNum();
$numUsers = $query->usersByNum();
$numFeatured = $query->featuredByNum();
$listClans = $query->clansLimited();
$totalPages = ceil($numClans / $query->no_of_records_per_page);
?>
<div class="container-fluid col-11 col-md-9 mt-2">
<div class="container-fluid col-10 col-md-10">
<div class="row text-white">
<div class="container-fluid col-4 pl-0 pr-1">
<div class="card bg-primary-gradient col-12">
<div class="card-header row">Users</div>
<div class="card-body row">
<i class="fas fa-users my-auto display-4"></i>
<h2 class="display-4 my-auto ml-auto"><?=$numUsers ?></h2>
</div>
</div>
</div>
<div class="container-fluid col-4 px-1">
<div class="card bg-info-gradient col-12">
<div class="card-header row">Clans</div>
<div class="card-body row">
<i class="fas fa-gopuram my-auto display-4"></i>
<h2 class="display-4 my-auto ml-auto"><?=$numClans; ?></h2>
</div>
</div>
</div>
<div class="container-fluid col-4 pr-0 pl-1">
<div class="card bg-success-gradient col-12">
<div class="card-header row">Featured</div>
<div class="card-body row">
<i class="fas fa-star my-auto display-4"></i>
<h2 class="display-4 my-auto ml-auto"><?=$numFeatured; ?></h2>
</div>
</div>
</div>
</div>
<div class="row mt-2">
<table class="table table-hover table-striped">
<thead class="text-white bg-dark">
<tr>
<th scope="col">Clan Image</th>
<th scope="col">Clan Name</th>
<th class="text-center" scope="col">Edit</th>
<th class="text-center" scope="col">Delete</th>
</tr>
</thead>
<tbody>
<?php while ($row = $listClans->fetch_assoc()): ?>
<tr>
<th scope="row"><img src="images/<?=$row['picture'];?>" style="height: 32px; width: auto;" /></td>
<td><?=$row['name']; ?></td>
<td class="text-center"><a href="edit.php?id=<?=$row['id']; ?>"><button class="btn btn-primary btn-sm"><i class="fas fa-pencil-alt"></i></button></a></td>
<td class="text-center"><a href="delete.php?id=<?=$row['id']; ?>"><button class="btn btn-danger btn-sm"><i class="fas fa-trash-alt"></i></button></a></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link" href="<?php echo $query->pageno <= 1 ? '#' : '?pageno='.($query->pageno -1); ?>" tabindex="-1">Previous</a>
</li>
<?php for ($x = 1; $x <= $totalPages; $x++): ?>
<li class="page-item <?php echo $query->pageno == $x ? 'active' : ''; ?>"><a class="page-link" href="?pageno=<?=$x?>"><?=$x?></a></li>
<?php endfor; ?>
<li class="page-item">
<a class="page-link" href="<?php echo $query->pageno >= $totalPages ? '#' : '?pageno='.($query->pageno + 1) ?>">Next</a>
</li>
</ul>
</div>
</div>
<?php include('adminfooter.php'); ?>