This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
mutes.php
70 lines (70 loc) · 2.75 KB
/
mutes.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
<?php
include 'includes/head.php';
include 'includes/header.php';
?>
<head>
<title>Mutes/TempMutes - <?php echo $name; ?></title>
</head>
<?php
// <<-----------------Database Connection------------>> //
require 'includes/data/database.php';
$sql = 'SELECT name, reason, muter, time, expires FROM mutes ORDER BY time DESC LIMIT 20';
$retval = $conn->query($sql);
?>
<body>
<div class="container content">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Mutes</h1>
<table class="table table-hover table-bordered table-condensed">
<thead>
<tr>
<th>
<center>Name</center>
</th>
<th>
<center>Muted By</center>
</th>
<th>
<center>Reason</center>
</th>
<th>
<center>Muted On</center>
</th>
<th>
<center>Muted Until</center>
</th>
</tr>
</thead>
<tbody>
<?php while($row = $retval->fetch_assoc()) {
if($row['banner'] == null) {
$row['banner'] = 'Console';
}
// <<-----------------Ban Date Converter------------>> //
$timeEpoch = $row['time'];
$timeConvert = $timeEpoch / 1000;
$timeResult = date('F j, Y, g:i a', $timeConvert);
// <<-----------------Expiration Time Converter------------>> //
$expiresEpoch = $row['expires'];
$expiresConvert = $expiresEpoch / 1000;
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
?>
<tr>
<td><?php echo "<img src='https://mcapi.ca/avatar/2d/" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name'];?></td>
<td><?php echo "<img src='https://mcapi.ca/avatar/2d/" . $row['banner'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['banner'];?></td>
<td style="width: 30%;"><?php echo $row['reason'];?></td>
<td><?php echo $timeResult;?></td>
<td><?php if($row['expires'] == 0) {
echo 'Permanent Mute';
} else {
echo $expiresResult; }?></td>
</tr>
<?php }
$conn->close();
echo "</tbody></table>";
?>
</div>
</div>
<?php include 'includes/footer.php'; ?>
</div>