<?php
define( 'PROTECTOR', 1 );
include( 'files/path.php' );
include( $path . 'files/db.php' );
include( $path . 'files/auth.php' );
include( $path . 'files/func.php' );
$textl = 'Лишённые бессмертия';
include( $path . 'files/core.php' );
include( $path . 'files/head.php' );
include( $path . 'files/zag.php' );
switch ( $_GET[ 'mod' ] )
{
    default:
        echo '<div class="main"><div class="block_zero center"><span style="color: #9bc;">Нам будет не хватать Вас!</span></div><div class="mini-line"></div><div class="block_zero center"><img src="image/logo/zona.png" width="120" height="60" alt="logo"></div><div class="dot-line"></div>';
        if ( $_GET[ 'page' ] == '' || $_GET[ 'page' ] < 0 || $_GET[ 'page' ] == 0 )
          {
            $_GET[ 'page' ] = 0;
          } //$_GET[ 'page' ] == '' || $_GET[ 'page' ] < 0 || $_GET[ 'page' ] == 0
        $next = $_GET[ 'page' ] + 1;
        $back = $_GET[ 'page' ] - 1;
        $num  = $_GET[ 'page' ] * 10;
        if ( $_GET[ 'page' ] == 0 )
          {
            $i = 1;
          } //$_GET[ 'page' ] == 0
        else
          {
            $i = ( $_GET[ 'page' ] * 10 ) + 1;
          }
        $viso   = mysql_num_rows( mysql_query( "SELECT `block` FROM `ban`" ) );
        $puslap = floor( $viso / 10 );
        $time   = time();
        $req    = mysql_query( "SELECT * FROM `ban` ORDER BY `id` LIMIT $num,10" );
        $avto   = mysql_num_rows( $req );
        if ( $avto >= 1 )
          {
            While ( $mag = mysql_fetch_array( $req ) )
              {
                echo '<div class="block_zero">' . $i . '. <a href="search.php?nick=' . $mag[ 'usr' ] . '&amp;go=go"> ' . $mag[ 'usr' ] . '</a><a href="zona.php?mod=1&amp;id=' . $mag[ 'id' ] . '"><span style="float: right;"><span style="color: #c66;">Причина</span></span></a></div><div class="dot-line"></div>';
                $i++;
              } //$mag = mysql_fetch_array( $req )
          } //$avto >= 1
        else
          {
            echo '<div class="block_zero center">Нет лишённых бессмертия!</div><div class="dot-line"></div>';
          }
        echo '<div class="block_zero center">';
        if ( $_GET[ 'page' ] > 0 )
          {
            echo '<a href="zona.php?page=' . $back . '"><< Назад - |</a>';
          } //$_GET[ 'page' ] > 0
        if ( $_GET[ 'page' ] < $puslap || $_GET[ 'page' ] == '' || $_GET[ 'page' ] == 0 )
          {
            echo '<a href="zona.php?page=' . $next . '">| - Далее >></a>';
          } //$_GET[ 'page' ] < $puslap || $_GET[ 'page' ] == '' || $_GET[ 'page' ] == 0
        break;
    case '1':
        if ( empty( $_GET[ 'id' ] ) )
          {
            echo '<div class="block_zero center">Нет такого лишённого бессмертия!</div>';
            include( $path . 'files/down.php' );
            exit;
          } //empty( $_GET[ 'id' ] )
        $req  = mysql_query( "SELECT * FROM `ban` WHERE `id` = '" . mysql_real_escape_string( $_GET[ 'id' ] ) . "' LIMIT 1" );
        $avto = mysql_num_rows( $req );
        if ( $avto == 1 )
          {
            $ban = mysql_fetch_array( $req );
            if ( $ban[ 'ban_time' ] < $t )
              {
                mysql_query( "DELETE FROM `ban` WHERE `usr` = '$log'" );
              } //$ban[ 'ban_time' ] < $t
            else
              {
                $vrem = $ban[ 'ban_time' ] - time();
                echo '<div class="main"><div class="block_zero">' . $ban[ 'usr' ] . '<span style="color: #ff3434;"> лишён бессмертия!<br>Причина: ' . $ban[ 'text' ] . '<br>Осталось: ' . Sec2Time( $vrem ) . '<br>Забанил: ' . $ban[ 'admin' ] . '</span></div>';
              }
          } //$avto == 1
        else
          {
            echo '<div class="block_zero center">Нет такого лишённого бессмертия!</div>';
          }
        echo '</div><div class="dot-line"></div><div class="main"><div class="block_zero"><a href="javascript:history.go(-1)"><span style="color: #999;"><< Назад</span></a></div></div></div>';
        break;
} //$_GET[ 'mod' ]
echo '</div></div>';
include( $path . 'files/down.php' );
?>