<!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>
-->
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />

<html xmlns="http://www.w3.org/1999/xhtml" class="inner"><head><title>Таблица банов Classic</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">Бан лист на v1.41</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="/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="/monitor.php"><?=$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 class="tr_backimg"><h5 align="center">[ Доска позора ]</h5></td>
    </tr>
    <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="150"><b>Ник</b></td>
                    <td align="left" width="150"><b>Дата</b></td>
                    <!--<td align="left" width="150">IP-адрес</td>-->
                    <!--<td>Админ</td>-->
                    <td align="left" width="150"><b>Причина</b></td>
                    <td width="200"><b>Срок бана</b></td>
                </tr>
<?php
//function compare_datetime($ban1, $ban2) {
//	return strtotime($ban1->datetime) < strtotime($ban2->datetime);
//}
function compare_date($ban1, $ban2) { 
    return strtotime($ban1->datetime, $ban2->datetime); 
} 

$bans = simplexml_load_file('/opt/bf2-141/bf2-v2/mods/bf2/settings/mm_bans.xml');
//$items = $bans->xpath('ban');
$items = $bans->xpath('ban');
//usort($items, 'compare_datetime');
usort($items, 'compare_date');
foreach($items as $ban)

//foreach($bans->ban as $ban)
{
    switch($ban->period)
    {
        case 'Perm':
            $ban->period = 'Никогда';
            break;


        case '1800':
            $ban->period = '30 мин';
            break;


        case '3600':
            $ban->period = '1 час';
            break;


        case '5400':
            $ban->period = '1 час 30 мин';
            break;


        case '7200':
            $ban->period = '2 час';
            break;


        case '9000':
            $ban->period = '2 час 30 мин';
            break;


        case '10800':
            $ban->period = '3 час';
            break;


        case '12600':
            $ban->period = '3 час 30 мин';
            break;


        case '14400':
            $ban->period = '4 час';
            break;


        case '86400':
            $ban->period = '1 день';
            break;
    }
    ?>
                <tr>
                    <!--<td align="left"><?php echo $ban->datetime; ?></td>-->
                    <td align="left"><?php echo $ban->nick; ?></td>
                    <td align="left"><?php echo $ban->datetime; ?></td>
                    <!--<td align="left"><?php echo $ban->address; ?></td>-->
                    <!--<td align="center"><?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>