<body bgcolor=#333333>
<?php
/* Kz-Arg SQL TOP by ReymonARG. Dont Allow to edit this file */
define("DB_HOST", "127.0.0.1");
define("DB_USER", "root");
define("DB_PASS", "123456789");
define("DB_NAME", "amxx");
$mode = $_GET['mode'];
$map = $_GET['map'];
$sql = @mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Unable to connect to MySQL.");
mysql_select_db(DB_NAME, $sql) or die ("Unable to select database.");
if( isset($mode) )
{
if( $mode == 'pro15' && isset($map) )
{
echo "<table align=center width=87%% cellpadding=0 cellspacing=2 border=0>";
if(!eregi("^[a-z0-9_]+$", $map))
return;
$q = "SELECT * FROM kz_pro15 WHERE mapname='". $map ."' ORDER BY time, name LIMIT 15";
$r = mysql_query($q, $sql);
echo "<tr align=center bgcolor=#999999><th width=2%% align=center> # <th width=3%% align=center>Flag<th width=15%% align=center>Name<th width=8%% align=center>Time<th width=6%% align=center>Date<th width=6%% align=center>Weapon<th width=8%% align=center>Server";
for($i = 1; $a = mysql_fetch_array($r); $i++) {
$t = $a["time"];
$date = strtotime($a["date"]);
$idate = date('m.d.y', $date);
$iMin = floor(floor($t)/60);
$iSec = $t - (60*$iMin);
$text = sprintf("%02d:%s%.6f", $iMin, $iSec < 10 ? "0": "", $iSec);
$name = str_replace("<", "<", $a["name"]);
$imagen=$a["country"];
echo "<tr align=center><td><p align=center><font color=#FFFFFF size=2><b>$i</b></font></td><td><p align=center><img src=\"banderas/$imagen.gif\" width=18 height=12> </td><td><p align=center><font color=#ffffff size=2><b>". $name ."</b></font></td><td><p align=center><font color=#00A1FF size=2><b>". $text ."</b></font></td><td><p align=center><font color=#FFF000 size=2><b>". $idate ."</b></font></td><td><p align=center><font color=#ffffff size=2>". $a["weapon"] ."</font></td><td><p align=center><font color=#33ff00 size=2><b>". $a["server"] ."</b></font></td></tr>";
}
echo "</table>";
mysql_free_result($r);
}
else if( $mode == 'pro15' && !isset($map) )
{
echo "<table align=center width=95%% cellpadding=0 cellspacing=2 border=0>";
$q = "SELECT * FROM kz_pro15 ORDER BY mapname, time, name";
$r = mysql_query($q, $sql);
echo "<tr align=center bgcolor=#999999><th width=8%% align=center> MapName <th width=3%% align=center>Flag<th width=15%% align=center>Name<th width=8%% align=center>Time<th width=6%% align=center>Date<th width=6%% align=center>Weapon<th width=8%% align=center>Server";
while($a = mysql_fetch_array($r))
{
if(strcmp($a["mapname"], $last))
{
$t = $a["time"];
$climbers[$a["name"]]++;
$name = str_replace("<", "<", $a["name"]);
$date = strtotime($a["date"]);
$idate = date('m.d.y', $date);
$imagen=$a["country"];
$iMin = floor(floor($t)/60);
$iSec = $t - (60*$iMin);
$text = sprintf("%02d:%s%.6f", $iMin, $iSec < 10 ? "0": "", $iSec);
echo "<tr align=center><td><p align=center><font color=#33ff00 size=2><b><a href='top15.php?mode=pro15&map=". $a["mapname"] ."'>". $a["mapname"] ."</a></b></font></td><td><p align=center><img src=\"banderas/$imagen.gif\" width=18 height=12> </td><td><p align=center><font color=#ffffff size=2><b>". $name ."</b></font></td><td><p align=center><font color=#33ff00 size=2><b>". $text ."</b></font></td><td><p align=center><font color=#33ff00 size=2><b>". $idate ."</b></font></td><td><p align=center><font color=#ffffff size=2>". $a["weapon"] ."</font></td><td><p align=center><font color=#33ff00 size=2><b>". $a["server"] ."</b></font></td></tr>";
}
$last = $a["mapname"];
}
}
else if( $mode == 'nub15' && isset($map) )
{
echo "<table align=center width=90%% cellpadding=0 cellspacing=2 border=0>";
if(!eregi("^[a-z0-9_]+$", $map))
return;
$q = "SELECT * FROM kz_nub15 WHERE mapname='". $map ."' ORDER BY time, name LIMIT 15";
$r = mysql_query($q, $sql);
echo "<tr align=center bgcolor=#999999><th width=2%% align=center> # <th width=3%% align=center>Flag<th width=15%% align=center>Name<th width=8%% align=center>Time<th width=6%% align=center>Date<th width=6%% align=center>Weapon<th width=7%% align=center>GoChecks<th width=8%% align=center>Server";
for($i = 1; $a = mysql_fetch_array($r); $i++) {
$t = $a["time"];
$date = strtotime($a["date"]);
$idate = date('m.d.y', $date);
$iMin = floor(floor($t)/60);
$iSec = $t - (60*$iMin);
$text = sprintf("%02d:%s%.6f", $iMin, $iSec < 10 ? "0": "", $iSec);
$name = str_replace("<", "<", $a["name"]);
$imagen=$a["country"];
echo "<tr align=center><td><p align=center><font color=#33ff00 size=2><b>$i</b></font></td><td><p align=center><img src=\"banderas/$imagen.gif\" width=18 height=12> </td><td><p align=center><font color=#ffffff size=2><b>". $name ."</b></font></td><td><p align=center><font color=#00A1FF size=2><b>". $text ."</b></font></td><td><p align=center><font color=#FFF000 size=2><b>". $idate ."</b></font></td><td><p align=center><font color=#ffffff size=2>". $a["weapon"] ."</font></td><td><p align=center><font color=#33ff00 size=2><b>". $a["gocheck"] ."</b></font></td><td><p align=center><font color=#33ff00 size=2><b>". $a["server"] ."</b></font></td></tr>";
}
echo "</table>";
mysql_free_result($r);
}
else if( $mode == 'nub15' && !isset($map) )
{
echo "<table align=center width=95%% cellpadding=0 cellspacing=2 border=0>";
$q = "SELECT * FROM kz_nub15 ORDER BY mapname, time, name";
$r = mysql_query($q, $sql);
echo "<tr align=center bgcolor=#999999><th width=8%% align=center> MapName <th width=3%% align=center>Flag<th width=15%% align=center>Name<th width=8%% align=center>Time<th width=6%% align=center>Date<th width=6%% align=center>Weapon<th width=7%% align=center>GoChecks<th width=8%% align=center>Server";
while($a = mysql_fetch_array($r))
{
if(strcmp($a["mapname"], $last))
{
$t = $a["time"];
$climbers[$a["name"]]++;
$name = str_replace("<", "<", $a["name"]);
$date = strtotime($a["date"]);
$idate = date('m.d.y', $date);
$imagen=$a["country"];
$iMin = floor(floor($t)/60);
$iSec = $t - (60*$iMin);
$text = sprintf("%02d:%s%.6f", $iMin, $iSec < 10 ? "0": "", $iSec);
echo "<tr align=center><td><p align=center><font color=#33ff00 size=2><b><a href='top15.php?mode=nub15&map=". $a["mapname"] ."'>". $a["mapname"] ."</a></b></font></td><td><p align=center><img src=\"banderas/$imagen.gif\" width=18 height=12> </td><td><p align=center><font color=#ffffff size=2><b>". $name ."</b></font></td><td><p align=center><font color=#33ff00 size=2><b>". $text ."</b></font></td><td><p align=center><font color=#33ff00 size=2><b>". $idate ."</b></font></td><td><p align=center><font color=#ffffff size=2>". $a["weapon"] ."</font></td><td><p align=center><font color=#33ff00 size=2><b>". $a["gocheck"] ."</b></font></td><td><p align=center><font color=#33ff00 size=2><b>". $a["server"] ."</b></font></td></tr>";
}
$last = $a["mapname"];
}
}
}
else
{
echo "<p align=center><font color=#33ff00 size=2><b><a href='top15.php?mode=pro15'>PRO 15</a></b></font>";
echo "<p align=center><font color=#33ff00 size=2><b><a href='top15.php?mode=nub15'>NUB 15</a></b></font>";
}
mysql_close($sql);
?>