[upd] mysql driver to mysqli
This commit is contained in:
parent
d20c4eee82
commit
6d5fb043ae
416
index.php
416
index.php
|
@ -1,333 +1,243 @@
|
||||||
<?php
|
<?php
|
||||||
|
$start = microtime(true);
|
||||||
$config = parse_ini_file('bin/bancount.cfg');
|
$config = parse_ini_file('bin/bancount.cfg');
|
||||||
|
|
||||||
echo "<!DOCTYPE html>\n";
|
echo "<!DOCTYPE html>\n";
|
||||||
echo "<html lang='en'>\n";
|
echo "<html lang='en'>\n";
|
||||||
echo "<head>\n";
|
echo "<head>\n";
|
||||||
echo "\t<title>",$config['title'],"</title>\n";
|
echo "\t<title>", $config['title'], "</title>\n";
|
||||||
echo "\t<meta http-equiv='content-type' content='text/html; charset=utf-8' />\n";
|
echo "\t<meta http-equiv='content-type' content='text/html; charset=utf-8' />\n";
|
||||||
echo "\t<meta name='description' content=",$config['title']," />\n";
|
echo "\t<meta name='description' content=", $config['title'], " />\n";
|
||||||
echo "\t<!-- CSS/STYLESHEET -->\n";
|
echo "\t<!-- CSS/STYLESHEET -->\n";
|
||||||
echo "\t<link rel='stylesheet' href='/bancount.css' type='text/css' />\n";
|
echo "\t<link rel='stylesheet' href='/bancount.css' type='text/css' />\n";
|
||||||
echo "</head>\n";
|
echo "</head>\n";
|
||||||
echo "<body>\n";
|
echo "<body>\n";
|
||||||
echo "<div id='header'>\n";
|
echo "<div id='header'>\n";
|
||||||
|
|
||||||
|
|
||||||
// Fail2BanCount - Displays information from the database
|
// Fail2BanCount - Displays information from the database
|
||||||
// I won't claim this is all my original code, as it has
|
// I won't claim this is all my original code, as it has
|
||||||
// been borrowed from various places online. Use it as you
|
// been borrowed from various places online. Use it as you
|
||||||
// like.
|
// like.
|
||||||
|
|
||||||
// Database connection info
|
// Database connection info
|
||||||
|
|
||||||
$db_host = '127.0.0.1';
|
$db_host = '127.0.0.1';
|
||||||
$db_user = $config['mysqluser'];
|
$db_user = $config['mysqluser'];
|
||||||
$db_pwd = $config['mysqlpw'];
|
$db_pwd = $config['mysqlpw'];
|
||||||
$database = $config['mysqldb'];
|
$database = $config['mysqldb'];
|
||||||
|
|
||||||
// Page variable
|
// Page variable
|
||||||
|
|
||||||
$page = htmlspecialchars($_GET["page"]);
|
$page = htmlspecialchars($_GET["page"]);
|
||||||
$orderby = htmlspecialchars($_GET["orderby"]);
|
$orderby = htmlspecialchars($_GET["orderby"]);
|
||||||
|
|
||||||
// Connect to MySQL
|
// Connect to MySQL
|
||||||
|
if (!$db = mysqli_connect($db_host, $db_user, $db_pwd)) {
|
||||||
if (!mysql_connect($db_host, $db_user, $db_pwd))
|
die("Can't connect to database");
|
||||||
die("Can't connect to database");
|
}
|
||||||
|
if (!mysqli_select_db($db,$database)) {
|
||||||
// Select the database
|
mysqli_close($db);
|
||||||
|
die("Can't select database");
|
||||||
if (!mysql_select_db($database))
|
}
|
||||||
die("Can't select database");
|
|
||||||
|
|
||||||
// Get some information from the database
|
// Get some information from the database
|
||||||
|
|
||||||
// Find IPs banned more than once
|
// Find IPs banned more than once
|
||||||
|
$multiplebans = mysqli_query($db, "SELECT ip,COUNT(*) count,country FROM bans GROUP BY ip HAVING count > 1 ORDER BY count DESC");
|
||||||
$multiplebans = mysql_query("SELECT ip,COUNT(*) count,country FROM bans GROUP BY ip HAVING count > 1 ORDER BY count DESC");
|
|
||||||
if (!$multiplebans) {
|
if (!$multiplebans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the IPs currently banned
|
// Find the IPs currently banned
|
||||||
|
$currentbans = mysqli_query($db, "SELECT service,ip,ban_date,ban_time,country FROM bans WHERE bans.id NOT IN ( SELECT unbans.id FROM unbans WHERE bans.id=unbans.id)");
|
||||||
$currentbans = mysql_query("SELECT service,ip,ban_date,ban_time,country FROM bans WHERE bans.id NOT IN ( SELECT unbans.id FROM unbans WHERE bans.id=unbans.id)");
|
|
||||||
if (!$currentbans) {
|
if (!$currentbans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the total number of IPs banned
|
// Find the total number of IPs banned
|
||||||
|
$totalbans = mysqli_query($db, "SELECT MAX(id) FROM bans");
|
||||||
$totalbans = mysql_query("SELECT MAX(id) FROM bans");
|
|
||||||
if (!$totalbans) {
|
if (!$totalbans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
while($row = mysql_fetch_array($totalbans)) {
|
while ($row = mysqli_fetch_array($totalbans)) {
|
||||||
$numbans = $row['MAX(id)'];
|
$numbans = $row['MAX(id)'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the total number of IPs unbanned
|
// Find the total number of IPs unbanned
|
||||||
|
$totalunbans = mysqli_query($db, "SELECT MAX(id) FROM unbans");
|
||||||
$totalunbans = mysql_query("SELECT MAX(id) FROM unbans");
|
|
||||||
if (!$totalunbans) {
|
if (!$totalunbans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
while($row = mysql_fetch_array($totalunbans)) {
|
while ($row = mysqli_fetch_array($totalunbans)) {
|
||||||
$numunbans = $row['MAX(id)'];
|
$numunbans = $row['MAX(id)'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find multiple country bans
|
// Find multiple country bans
|
||||||
|
$countrybans = mysqli_query($db, "SELECT country,COUNT(*) count FROM bans GROUP BY country ORDER BY count DESC LIMIT 10");
|
||||||
$countrybans = mysql_query("SELECT country,COUNT(*) count FROM bans GROUP BY country ORDER BY count DESC LIMIT 10");
|
|
||||||
if (!$countrybans) {
|
if (!$countrybans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display every IP banned
|
// Display every IP banned
|
||||||
|
|
||||||
// Order by ID
|
// Order by ID
|
||||||
|
$allbans = mysqli_query($db, "SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY id");
|
||||||
$allbans = mysql_query("SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY id");
|
|
||||||
if (!$multiplebans) {
|
if (!$multiplebans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order by IP
|
// Order by IP
|
||||||
|
$allbans_ip = mysqli_query($db, "SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY ip");
|
||||||
$allbans_ip = mysql_query("SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY ip");
|
|
||||||
if (!$multiplebans) {
|
if (!$multiplebans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order by Date
|
// Order by Date
|
||||||
|
$allbans_date = mysqli_query($db, "SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY ban_date");
|
||||||
$allbans_date = mysql_query("SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY ban_date");
|
|
||||||
if (!$multiplebans) {
|
if (!$multiplebans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order by Time
|
// Order by Time
|
||||||
|
$allbans_time = mysqli_query($db, "SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY ban_time");
|
||||||
$allbans_time = mysql_query("SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY ban_time");
|
|
||||||
if (!$multiplebans) {
|
if (!$multiplebans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order by Country
|
// Order by Country
|
||||||
|
$allbans_country = mysqli_query($db, "SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY country");
|
||||||
$allbans_country = mysql_query("SELECT id,service,ip,ban_date,ban_time,country FROM bans ORDER BY country");
|
|
||||||
if (!$multiplebans) {
|
if (!$multiplebans) {
|
||||||
die("Query failed.");
|
die("Query failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Find the number of currently banned IP's using subtraction.
|
// Find the number of currently banned IP's using subtraction.
|
||||||
// I'm sure I can do this with a single MySQL query and get
|
// I'm sure I can do this with a single MySQL query and get
|
||||||
// rid of the above 2 queries all together.
|
// rid of the above 2 queries all together.
|
||||||
|
|
||||||
$currentlybanned = $numbans - $numunbans;
|
$currentlybanned = $numbans - $numunbans;
|
||||||
|
|
||||||
// Print some HTML
|
// Print some HTML
|
||||||
|
echo "\t<h1>", $config['title'], "</h1>\n";
|
||||||
echo "\t<h1>",$config['title'],"</h1>\n";
|
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
echo "<div id='container'>\n";
|
echo "<div id='container'>\n";
|
||||||
|
|
||||||
echo "\t<h3>$numbans IPs have been banned.</h3>\n";
|
echo "\t<h3>$numbans IPs have been banned.</h3>\n";
|
||||||
|
|
||||||
// Menu
|
// Menu
|
||||||
|
|
||||||
echo "\t<div class='table'>\n";
|
echo "\t<div class='table'>\n";
|
||||||
echo "\t\t<div class='row'>\n";
|
echo "\t\t<div class='row'>\n";
|
||||||
echo "\t\t\t<a href='?page=home' class='menu'>Home</a>\n";
|
echo "\t\t\t<a href='?page=home' class='menu'>Home</a>\n";
|
||||||
echo "\t\t\t<a href='?page=allbans' class='menu'>All Bans</a>\n";
|
echo "\t\t\t<a href='?page=allbans' class='menu'>All Bans</a>\n";
|
||||||
echo "\t\t</div>\n";
|
echo "\t\t</div>\n";
|
||||||
echo "\t</div>\n";
|
echo "\t</div>\n";
|
||||||
|
|
||||||
switch ($page) {
|
switch ($page) {
|
||||||
|
default :
|
||||||
default:
|
// Begin creating the first table of IPs that have been banned
|
||||||
|
// more than once.
|
||||||
// Begin creating the first table of IPs that have been banned
|
echo "\t<div class='table'>\n";
|
||||||
// more than once.
|
echo "\t\t<div class='row'>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tIP\n\t\t\t</div>\n";
|
||||||
echo "\t<div class='table'>\n";
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tBans\n\t\t\t</div>\n";
|
||||||
echo "\t\t<div class='row'>\n";
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tCountry\n\t\t\t</div>\n";
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tIP\n\t\t\t</div>\n";
|
echo "\t\t</div>\n";
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tBans\n\t\t\t</div>\n";
|
// Print the data obtained from the MySQL database
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tCountry\n\t\t\t</div>\n";
|
// Print the first table
|
||||||
echo "\t\t</div>\n";
|
while ($row = mysqli_fetch_row($multiplebans)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
// Print the data obtained from the MySQL database
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
// Print the first table
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
while($row = mysql_fetch_row($multiplebans)) {
|
echo "\t</div>\n";
|
||||||
echo "\t\t<div class='row'>\n";
|
mysqli_free_result($multiplebans);
|
||||||
foreach($row as $cell)
|
// Use correct grammer
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
if ($currentlybanned != 1) {
|
||||||
echo "\t\t</div>\n";
|
$grammer = "IPs are";
|
||||||
|
} else {
|
||||||
|
$grammer = "IP is";
|
||||||
|
}
|
||||||
|
echo "\t<h3>Currently $currentlybanned $grammer banned.</h3>\n";
|
||||||
|
// Only print the second table if we have an IP
|
||||||
|
// currently banned.
|
||||||
|
if ($numbans > $numunbans) {
|
||||||
|
// Print the data obtained from the MySQL database
|
||||||
|
// Table title
|
||||||
|
echo "\t<h2>Currently Banned</h2>\n";
|
||||||
|
// Create the second table, of currently banned IPs
|
||||||
|
echo "\t<div class='table'>\n";
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tService\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tIP\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tDate\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tTime\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tCountry\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
// Print out the second table
|
||||||
|
while ($row = mysqli_fetch_row($currentbans)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
|
echo "\t</div>\n";
|
||||||
|
mysqli_free_result($currentbans);
|
||||||
|
}
|
||||||
|
// Print more HTML
|
||||||
|
echo "\t<h2>Top 10 Countries</h2>\n";
|
||||||
|
// Begin creating the second table of counrtys that have been banned
|
||||||
|
// more than once.
|
||||||
|
echo "\t<div class='table'>\n";
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tCountry\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tBans\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
// Print the first table
|
||||||
|
while ($row = mysqli_fetch_row($countrybans)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
|
echo "\t</div>\n";
|
||||||
|
mysqli_free_result($countrybans);
|
||||||
|
break;
|
||||||
|
case "allbans" :
|
||||||
|
echo "\t<div class='table'>\n";
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
echo "\t\t\t<a href='?page=allbans&orderby=id' class='cell-header'>\n\t\t\t\t\n\t\t\t</a>\n";
|
||||||
|
echo "\t\t\t<a href='?page=allbans&orderby=ip' class='cell-header'>\n\t\t\t\t<u>Service</u>\n\t\t\t</a>\n";
|
||||||
|
echo "\t\t\t<a href='?page=allbans&orderby=ip' class='cell-header'>\n\t\t\t\t<u>IP</u>\n\t\t\t</a>\n";
|
||||||
|
echo "\t\t\t<a href='?page=allbans&orderby=date' class='cell-header'>\n\t\t\t\t<u>Ban Date</u>\n\t\t\t</a>\n";
|
||||||
|
echo "\t\t\t<a href='?page=allbans&orderby=time' class='cell-header'>\n\t\t\t\t<u>Ban Time</u>\n\t\t\t</a>\n";
|
||||||
|
echo "\t\t\t<a href='?page=allbans&orderby=country' class='cell-header'>\n\t\t\t\t<u>Country</u>\n\t\t\t</a>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
switch ($orderby) {
|
||||||
|
default :
|
||||||
|
case "id" :
|
||||||
|
while ($row = mysqli_fetch_row($allbans)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
|
case "ip" :
|
||||||
|
while ($row = mysqli_fetch_row($allbans_ip)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "date" :
|
||||||
|
while ($row = mysqli_fetch_row($allbans_date)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "time" :
|
||||||
|
while ($row = mysqli_fetch_row($allbans_time)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "country" :
|
||||||
|
while ($row = mysqli_fetch_row($allbans_country)) {
|
||||||
|
echo "\t\t<div class='row'>\n";
|
||||||
|
foreach ($row as $cell)
|
||||||
|
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
||||||
|
echo "\t\t</div>\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
echo "\t</div>\n";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "\t</div>\n";
|
|
||||||
|
|
||||||
mysql_free_result($multiplebans);
|
|
||||||
|
|
||||||
// Use correct grammer
|
|
||||||
|
|
||||||
if ($currentlybanned != 1) {
|
|
||||||
$grammer = "IPs are";
|
|
||||||
} else {
|
|
||||||
$grammer = "IP is";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "\t<h3>Currently $currentlybanned $grammer banned.</h3>\n";
|
|
||||||
|
|
||||||
// Only print the second table if we have an IP
|
|
||||||
// currently banned.
|
|
||||||
|
|
||||||
if ($numbans > $numunbans) {
|
|
||||||
|
|
||||||
// Print the data obtained from the MySQL database
|
|
||||||
|
|
||||||
// Table title
|
|
||||||
|
|
||||||
echo "\t<h2>Currently Banned</h2>\n";
|
|
||||||
|
|
||||||
// Create the second table, of currently banned IPs
|
|
||||||
|
|
||||||
echo "\t<div class='table'>\n";
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tService\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tIP\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tDate\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tTime\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tCountry\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
|
|
||||||
// Print out the second table
|
|
||||||
|
|
||||||
while($row = mysql_fetch_row($currentbans)) {
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
foreach($row as $cell)
|
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "\t</div>\n";
|
|
||||||
|
|
||||||
mysql_free_result($currentbans);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print more HTML
|
|
||||||
echo "\t<h2>Top 10 Countries</h2>\n";
|
|
||||||
|
|
||||||
// Begin creating the second table of counrtys that have been banned
|
|
||||||
// more than once.
|
|
||||||
|
|
||||||
echo "\t<div class='table'>\n";
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tCountry\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t\t<div class='cell-header'>\n\t\t\t\tBans\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
|
|
||||||
// Print the first table
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while($row = mysql_fetch_row($countrybans)) {
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
foreach($row as $cell)
|
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "\t</div>\n";
|
|
||||||
|
|
||||||
mysql_free_result($countrybans);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "allbans":
|
|
||||||
|
|
||||||
echo "\t<div class='table'>\n";
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
echo "\t\t\t<a href='?page=allbans&orderby=id' class='cell-header'>\n\t\t\t\t\n\t\t\t</a>\n";
|
|
||||||
echo "\t\t\t<a href='?page=allbans&orderby=ip' class='cell-header'>\n\t\t\t\t<u>Service</u>\n\t\t\t</a>\n";
|
|
||||||
echo "\t\t\t<a href='?page=allbans&orderby=ip' class='cell-header'>\n\t\t\t\t<u>IP</u>\n\t\t\t</a>\n";
|
|
||||||
echo "\t\t\t<a href='?page=allbans&orderby=date' class='cell-header'>\n\t\t\t\t<u>Ban Date</u>\n\t\t\t</a>\n";
|
|
||||||
echo "\t\t\t<a href='?page=allbans&orderby=time' class='cell-header'>\n\t\t\t\t<u>Ban Time</u>\n\t\t\t</a>\n";
|
|
||||||
echo "\t\t\t<a href='?page=allbans&orderby=country' class='cell-header'>\n\t\t\t\t<u>Country</u>\n\t\t\t</a>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
|
|
||||||
switch ($orderby) {
|
|
||||||
|
|
||||||
default:
|
|
||||||
case "id":
|
|
||||||
|
|
||||||
while($row = mysql_fetch_row($allbans)) {
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
foreach($row as $cell)
|
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
case "ip":
|
|
||||||
|
|
||||||
while($row = mysql_fetch_row($allbans_ip)) {
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
foreach($row as $cell)
|
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "date":
|
|
||||||
|
|
||||||
while($row = mysql_fetch_row($allbans_date)) {
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
foreach($row as $cell)
|
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "time":
|
|
||||||
|
|
||||||
while($row = mysql_fetch_row($allbans_time)) {
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
foreach($row as $cell)
|
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "country":
|
|
||||||
|
|
||||||
while($row = mysql_fetch_row($allbans_country)) {
|
|
||||||
echo "\t\t<div class='row'>\n";
|
|
||||||
foreach($row as $cell)
|
|
||||||
echo "\t\t\t<div class='cell'>\n\t\t\t\t$cell\n\t\t\t</div>\n";
|
|
||||||
echo "\t\t</div>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "\t</div>\n";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
|
$stop = microtime(true);
|
||||||
|
$total = round($stop - $start, 4);
|
||||||
|
echo $total, '</br>';
|
||||||
echo "<div id='footer'>\n";
|
echo "<div id='footer'>\n";
|
||||||
echo "\t©",date("Y")," released under GNU GPL base on <a href='http://kylefberry.net'>k6b</a> work this version are made by Knah Tsaeb\n";
|
echo "\t©", date("Y"), " released under GNU GPL base on <a href='http://kylefberry.net'>k6b</a> work this version are made by Knah Tsaeb\n";
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
echo "</body>\n";
|
echo "</body>\n";
|
||||||
echo "</html>\n";
|
echo "</html>\n";
|
||||||
|
|
Loading…
Reference in New Issue