More cleanup

This commit is contained in:
Ruan 2015-03-12 07:34:46 +02:00
parent 647b52cf9b
commit 45dd505554
4 changed files with 24 additions and 42 deletions

View File

@ -5,7 +5,6 @@
<body> <body>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h1 class="page-header">Bans</h1> <h1 class="page-header">Bans</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -13,7 +12,6 @@
<li class="active">Bans</li> <li class="active">Bans</li>
</ol> </ol>
</div> </div>
</div> </div>
<div class="row" style="margin-bottom:60px;"> <div class="row" style="margin-bottom:60px;">
<div class="col-lg-12"> <div class="col-lg-12">
@ -41,24 +39,13 @@
<?php <?php
$result = run_query($table_bans); $result = run_query($table_bans);
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
// <<-----------------Ban Date Converter------------>> //
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");
$timeEpoch = $row['time']; $timeResult = date('F j, Y, g:i a', $row['time'] / 1000);
$timeConvert = $timeEpoch / 1000; $expiresResult = date('F j, Y, g:i a', $row['until'] / 1000);
$timeResult = date('F j, Y, g:i a', $timeConvert);
// <<-----------------Expiration Time Converter------------>> //
$expiresEpoch = $row['until'];
$expiresConvert = $expiresEpoch / 1000;
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
?> ?>
<tr> <tr>
<td><?php echo get_avatar($row['name']); ?> </td>
<td><?php $banned = $row['name']; <td><?php echo get_avatar($row['banned_by_name']); ?> </td>
echo "<img src='https://minotar.net/avatar/" . $banned . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $banned; ?>
</td>
<td><?php $banner = get_banner_name($row['banned_by_name']);
echo "<img src='https://minotar.net/avatar/" . $banner . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $banner ?>
</td>
<td style="width: 30%;"><?php echo $row['reason']; ?></td> <td style="width: 30%;"><?php echo $row['reason']; ?></td>
<td><?php echo $timeResult; ?></td> <td><?php echo $timeResult; ?></td>
<td> <td>
@ -74,8 +61,10 @@
</tr> </tr>
<?php } <?php }
$result->free(); $result->free();
echo "</tbody></table>"; $conn->close();
?> ?>
</tbody>
</table>
</div> </div>
</div> </div>
<?php include 'includes/footer.php'; ?> <?php include 'includes/footer.php'; ?>

View File

@ -17,4 +17,8 @@ function run_query($table) {
return $result; return $result;
} }
function get_avatar($name) {
return "<img src='https://minotar.net/avatar/" . $name . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $name;
}
?> ?>

View File

@ -5,7 +5,6 @@
<body> <body>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h1 class="page-header">Mutes</h1> <h1 class="page-header">Mutes</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -13,7 +12,6 @@
<li class="active">Mutes</li> <li class="active">Mutes</li>
</ol> </ol>
</div> </div>
</div> </div>
<div class="row" style="margin-bottom:60px;"> <div class="row" style="margin-bottom:60px;">
<div class="col-lg-12"> <div class="col-lg-12">
@ -31,20 +29,13 @@
<?php <?php
$result = run_query($table_mutes); $result = run_query($table_mutes);
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
// <<-----------------Ban Date Converter------------>> //
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");
$timeEpoch = $row['time']; $timeResult = date('F j, Y, g:i a', $row['time'] / 1000);
$timeConvert = $timeEpoch / 1000; $expiresResult = date('F j, Y, g:i a', $row['until'] / 1000);
$timeResult = date('F j, Y, g:i a', $timeConvert);
// <<-----------------Expiration Time Converter------------>> //
$expiresEpoch = $row['until'];
$expiresConvert = $expiresEpoch / 1000;
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
?> ?>
<tr> <tr>
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name']; ?></td> <td><?php echo get_avatar($row['name']); ?> </td>
<td><?php $banner = get_banner_name($row['banned_by_name']); <td><?php echo get_avatar($row['banned_by_name']); ?> </td>
echo "<img src='https://minotar.net/avatar/" . $banner . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $banner; ?></td>
<td style="width: 30%;"><?php echo $row['reason']; ?></td> <td style="width: 30%;"><?php echo $row['reason']; ?></td>
<td><?php echo $timeResult; ?></td> <td><?php echo $timeResult; ?></td>
<td> <td>
@ -60,8 +51,10 @@
</tr> </tr>
<?php } <?php }
$result->free(); $result->free();
echo "</tbody></table>"; $conn->close();
?> ?>
</tbody>
</table>
</div> </div>
</div> </div>
<?php include 'includes/footer.php'; ?> <?php include 'includes/footer.php'; ?>

View File

@ -5,7 +5,6 @@
<body> <body>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h1 class="page-header">Warnings</h1> <h1 class="page-header">Warnings</h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -13,7 +12,6 @@
<li class="active">Warnings</li> <li class="active">Warnings</li>
</ol> </ol>
</div> </div>
</div> </div>
<div class="row" style="margin-bottom:60px;"> <div class="row" style="margin-bottom:60px;">
<div class="col-lg-12"> <div class="col-lg-12">
@ -38,16 +36,12 @@
<?php <?php
$result = run_query($table_warnings); $result = run_query($table_warnings);
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
// <<-----------------Expiration Time Converter------------>> //
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");
$expiresEpoch = $row['until']; $expiresResult = date('F j, Y, g:i a', $row['until'] / 1000);
$expiresConvert = $expiresEpoch / 1000;
$expiresResult = date('F j, Y, g:i a', $expiresConvert);
?> ?>
<tr> <tr>
<td><?php echo "<img src='https://minotar.net/avatar/" . $row['name'] . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $row['name']; ?></td> <td><?php echo get_avatar($row['name']); ?> </td>
<td><?php $banner = get_banner_name($row['banned_by_name']); <td><?php echo get_avatar($row['banned_by_name']); ?> </td>
echo "<img src='https://minotar.net/avatar/" . $banner . "/25' style='margin-bottom:5px;margin-right:5px;border-radius:2px;' />" . $banner; ?></td>
<td style="width: 30%;"><?php echo $row['reason']; ?></td> <td style="width: 30%;"><?php echo $row['reason']; ?></td>
<td> <td>
<?php if ($row['until'] <= 0) { <?php if ($row['until'] <= 0) {
@ -62,8 +56,10 @@
</tr> </tr>
<?php } <?php }
$result->free(); $result->free();
echo "</tbody></table>"; $conn->close();
?> ?>
</tbody>
</table>
</div> </div>
</div> </div>
<?php include 'includes/footer.php'; ?> <?php include 'includes/footer.php'; ?>