clean up includes

This commit is contained in:
Ruan 2015-03-11 10:39:04 +02:00
parent d8bdfcec46
commit fa5d9b260c
6 changed files with 13 additions and 27 deletions

View File

@ -1,11 +1,8 @@
<?php include 'includes/head.php'; ?>
<?php include 'includes/header.php'; ?>
<head> <head>
<title>Bans/Tempbans - <?php echo $name; ?></title> <title>Tempbans - <?php echo $name; ?></title>
</head> </head>
<?php <?php
// <<-----------------mysql Database Connection------------>> // require 'includes/page.php';
require 'includes/data/database.php';
$table = $table_bans; $table = $table_bans;
$sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query . $sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query .
@ -14,11 +11,9 @@ $sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $t
if (!$result = $conn->query($sql)) { if (!$result = $conn->query($sql)) {
die('Query error [' . $conn->error . ']'); die('Query error [' . $conn->error . ']');
} }
?> ?>
<body> <body>
<div class="container"> <div class="container">
<!-- Example row of columns -->
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">

View File

@ -1,6 +1,4 @@
<?php <?php require 'includes/data/settings.php'; ?>
include 'includes/data/settings.php';
?>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">

5
includes/page.php Normal file
View File

@ -0,0 +1,5 @@
<?php
require 'head.php';
require 'header.php';
require 'data/database.php';
?>

View File

@ -6,8 +6,6 @@
<body> <body>
<div class="container"> <div class="container">
<!-- Main Page -->
<div class="jumbotron"> <div class="jumbotron">
<div style="text-align: center;"><h2>Welcome to <?php echo $name; ?>'s Ban List.</h2></div> <div style="text-align: center;"><h2>Welcome to <?php echo $name; ?>'s Ban List.</h2></div>
@ -15,7 +13,6 @@
</div> </div>
</div> </div>
<!-- /container -->
<?php <?php
include 'includes/footer.php'; include 'includes/footer.php';
?> ?>

View File

@ -1,11 +1,8 @@
<?php include 'includes/head.php'; ?>
<?php include 'includes/header.php'; ?>
<head> <head>
<title>Mutes/TempMutes - <?php echo $name; ?></title> <title>TempMutes - <?php echo $name; ?></title>
</head> </head>
<?php <?php
// <<-----------------mysql Database Connection------------>> // require 'includes/page.php';
require 'includes/data/database.php';
$table = $table_mutes; $table = $table_mutes;
$sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query . $sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query .
@ -17,7 +14,6 @@ if (!$result = $conn->query($sql)) {
?> ?>
<body> <body>
<div class="container"> <div class="container">
<!-- Example row of columns -->
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">

View File

@ -1,24 +1,19 @@
<?php include 'includes/head.php'; ?>
<?php include 'includes/header.php'; ?>
<head> <head>
<title>Warnings - <?php echo $name; ?></title> <title>Warnings - <?php echo $name; ?></title>
</head> </head>
<?php <?php
// <<-----------------mysql Database Connection------------>> // require 'includes/page.php';
require 'includes/data/database.php';
$table = $table_warnings; $table = $table_warnings;
$sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query . $sql = 'SELECT * FROM ' . $table . ' INNER JOIN ' . $table_history . ' on ' . $table . '.uuid=' . $table_history . '.uuid ' . $active_query .
' GROUP BY name ORDER BY time DESC LIMIT ' . $limit_per_page; ' GROUP BY name ORDER BY time DESC LIMIT ' . $limit_per_page;
if(!$result = $conn->query($sql)) { if (!$result = $conn->query($sql)) {
die('Query error [' . $conn->error . ']'); die('Query error [' . $conn->error . ']');
} }
?> ?>
<body> <body>
<div class="container"> <div class="container">
<!-- Example row of columns -->
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
@ -50,7 +45,7 @@ if(!$result = $conn->query($sql)) {
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php while($row = $result->fetch_assoc()){ <?php while ($row = $result->fetch_assoc()) {
// <<-----------------Expiration Time Converter------------>> // // <<-----------------Expiration Time Converter------------>> //
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");
$expiresEpoch = $row['until']; $expiresEpoch = $row['until'];