<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//RU" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
<html xmlns="http://www.w3.org/1999/xhtml" class="inner"><head><title><?php include_once('config.inc.php'); echo $PRETITLE; ?>Таблица банов</title>
-->
<?php 
# Ban loader settings here!
$serv_num = 1;
$serv_name = 'T~GAMER Ranked #1 | All Maps';
$serv_banfile = 'http://10.62.242.11/bans/'.$serv_num.'/mm_bans.xml';
?>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />

<html xmlns="http://www.w3.org/1999/xhtml" class="inner"><head><title>Список банов <?php echo $serv_name; ?></title>

<link rel="icon" href="./favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" media="screen" href="./css/two-tiers.css">
<link rel="stylesheet" type="text/css" media="screen" href="./css/nt.css">
<link rel="stylesheet" type="text/css" media="print" href="./css/print.css">
<link rel="stylesheet" type="text/css" media="screen" href="./css/default.css">

<xsl:sort data-type="number" select="substring-before(datetime,'.')"/>
<xsl:sort data-type="number" select="substring(datetime,6,2)"/>
<xsl:sort data-type="number" select="substring(datetime,9)"/>

<script type="text/javascript">/* no frames */ if(top.location != self.location) top.location.replace(self.location);</script>
<script type="text/javascript" src="./js/nt2.js"></script></head><body class="inner">

<div id="page-1">
    <div id="page-2">
    <h1 id="page-title">Бан лист на <?php echo $serv_name; ?></h1>
        <div id="page-3">
        <div id="content"><div id="content-id"><!-- template header end == begin content below -->
        <ul id="navitems">
            <li>|<a href="./"><?=$lang_main ?></a>|</li>
            <li><a href="./?go=forum"><?=$lang_forum ?></a>|</li>
            <li><a href="./?go=stats"><?=$lang_top ?></a>|</li>
            <li><a href="./?go=currentranking"><?=$lang_currentranking ?></a>|</li>
            <li><a href="./?go=lastrounds"><?=$lang_lastrounds ?></a>|</li>
            <li><a href="./?go=banlist"><?=$lang_banlist ?></a>|</li>
            <li><a href="./?go=monitor"><?=$lang_monetor ?></a>|</li>
            <li><a href="./?go=faq"><?=$lang_faq ?></a>|</li>
            <li><a href="./?go=ubar"><?=$lang_UBAR ?></a>|</li>
            <li><a href="http://wiki.bf2s.com/"><?=$lang_Wiki ?></a>|</li>
        </ul>
            
        <form action="./?go=search" method="post" id="getstats">
            <label for="pid"><?=$lang_search?>:</label>
            <input type="text" name="searchvalue" id="pid" value="" />
            <input type="submit" class="btn" value="Go" />
        </form>
    <br>
    <div id="content">
            <div id="content-id">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="stat sortable">
<table width="100%" align="center" class="zeroborders">
    <tr>
        <td>
            <table width="100%" border="0" cellspacing="2" cellpadding="0" /*class="basic-stat"*/ class="stat sortable">
                <tr align="center" valign="middle" class="title">
                    <!--<td align="left" width="150"><b>Дата</b></td>-->
                    <td align="left" width="100"><b>Ник</b></td>
                    <td align="left" width="105"><b><a href="#dt">Дата</a></b></td>
                    <!--<td align="left" width="150">IP-адрес</td>-->
                    <td align="left" width="95"><b>Админ</b></td>
                    <td align="left" width="300"><b>Причина</b></td>
                    <td width="65"><b>Срок бана</b></td>
                </tr>
<?php

$bans = simplexml_load_file($serv_banfile);
function compare_datetime($ban1, $ban2) {  
    return strtotime($ban1->datetime) < strtotime($ban2->datetime);
}
$items = $bans->xpath('ban');
usort($items, 'compare_datetime');
foreach($items as $ban)
{
    switch($ban->period)
    {
        case 'Perm':
            $ban->period = '<font color="#fa3202"><b>Навсегда</b></font>';
            break;

        case 'Round':
            $ban->period = '<font color="#fa7222"><b>Раунд<b></font>';
            break;

        default:
	    $ban->period = intval($ban->period / 3600);
	    $ban->period = '<font color="#fed302"><b>'.$ban->period.' ч.'.'</b></font>';
	    break;
    }
    ?>
                <tr>
                    <!--<td align="left"><?php echo $ban->datetime; ?></td>-->
                    <td align="left"><a name="ban_<?php echo str_replace(' ', '_', $ban->nick); ?>" href="#ban_<?php echo str_replace(' ', '_', $ban->nick); ?>"><?php echo $ban->nick; ?></a></td>
                    <td align="left"><?php echo date('Y-m-d H:i:s', strtotime($ban->datetime.' UTC')); ?></td>
                    <!--<td align="left"><?php echo $ban->address; ?></td>-->
                    <td align="left"><?php echo $ban->by; ?></td>
                    <td align="left"><?php echo $ban->reason; ?></td>
                    <td align="center"><?php echo $ban->period; ?></td>
                </tr>
    <?php
}
?>
            </table>
        </td>
    </tr>
</table>
