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
/
warnings.php
60 lines (60 loc) · 2.1 KB
/
warnings.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
<?php
include 'includes/head.php';
include 'includes/header.php';
?>
<head>
<title>Warnings - <?php echo $name; ?></title>
</head>
<?php
// <<-----------------Database Connection------------>> //
require 'includes/data/database.php';
$sql = 'SELECT name, reason, banner, expires FROM warnings ORDER BY expires DESC LIMIT 20';
$retval = $conn->query($sql);
?>
<body>
<div class="container content">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Warnings</h1>
<table class="table table-hover table-bordered table-condensed">
<thead>
<tr>
<th>
<center>Name</center>
</th>
<th>
<center>Warned By</center>
</th>
<th>
<center>Reason</center>
</th>
<th>
<center>Warned Until</center>
</th>
</tr>
</thead>
<tbody>
<?php while($row = $retval->fetch_assoc()) {
if($row['banner'] == null) {
$row['banner'] = 'Console';
}
// <<-----------------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 if($row['expires'] == 0) {
echo 'Permanent Warning';
} else {
echo $expiresResult; }?></td>
</tr>
<?php }
$conn->close();
echo "</tbody></table>";
?>
</div>
<?php include 'includes/footer.php'; ?>