<?php
session_start();
include_once "inc/db_connect.php";
include_once "inc/fnc.php";
header('Content-Type: text/html;charset=utf8');
$err = "";
if(isset($_POST['regok'])){unset($_SESSION['reg_ok']);}
if(!isset($_SESSION['user'])){
	header("Location: index.php?");
	exit();
}else{
	$data_user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE nick='".$_SESSION['user']."'")) or die(mysql_error());
	if($data_user['status'] == "Гонщик" or $data_user['status'] == "VIP" or $data_user['status'] == "Помощник" or $data_user['status'] == "Турнирщик"){
		header("Location: index.php?");
		exit();
	}else{
	$user = $_SESSION['user'];
	$dateig = date("H:i:s");
	$data_userid = $data_user['id'];
?>
<?
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html>';
echo '<head>';
	echo '<title>LowRaceClub</title>';
	echo '<meta http-equiv="Content-Type" content="text/html" charset="windows-1251" />';
	echo '<meta name="description" content="Мобильные онлайн гонки">';
if(empty($data_user['theme']) or $data_user['theme'] == 'default')
{
$style="/style/default/mobile.css";
}
if($data_user['theme'] == "twotheme")
{
$style="style/twotheme/mobile.css";
}
echo '<link rel="stylesheet" href="'.$style.'" type="text/css" />';
?>
<div class="inform">
	<div class="block"><img src="img/benz.png" alt="Бензин"/> <?=$data_user['fuel']?></div>
	<div class="block"><img src="img/speed.png" alt="Скорость" /> <?=$data_user['speed']?> л.с</div>
	<div class="block"><img src="img/money2.png" alt="Золото" /> <?=$data_user['money2']?></div>
	<div class="block"><img src="img/money.png" alt="Баксы" /> <?=$data_user['money']?></div><br><br>
	<div class="progress">
	<div class="progress2" style="width:<?=$levelimg?>%">
	</div></div>
	</div>
<?
echo '<div class="inform"><center>';
        echo '<div class="block"><a href="index.php"><b>Гараж</b></a></div>';
        echo '<div class="block"><a href="/race.php"><b>Гонки</b></a></div>';
        echo '<div class="block"><a href="/bar.php"><b>Бар</b></a></div>';
		echo '<div class="block"><a href="/city.php"><b>Город</b></a></div>';
echo '</center></div>';
?>
<div class="title">Бан</div>
<?php

if(isset($_POST['banned']))
{
	$ban = mysql_real_escape_string(strip_tags($_POST['ban']));
	$whoban = $data_user['nick'];
	$prich = mysql_real_escape_string(strip_tags($_POST['prich']));
	$id = trim(mysql_real_escape_string($_POST['id']));
mysql_query("UPDATE `users` SET banned='".$ban."',prich='".$prich."' WHERE id='".$id."'");
echo "<div class='inform'><center>Игрок забанен!</center></div>";
}

$hour = time()+3600;
$day = time()+86400;
$week = time()+604800;
$month = time()+2592000;
$pizda = time()+2591997408000;

echo "<div class='inform'><center><b>ВНИМАНИЕ! ТЕПЕРЬ ЧЕЛОВЕК В БАНЕ НЕ МОЖЕТ ИГРАТЬ! ИГРА ПОЛНОСТЬЮ БЛОКИРУЕТСЯ.</b></center></div>";
echo "<div class='inform'>
<form action='' method='post'>
БАН:<br/>
<select name='ban'>
<option value='$hour'>Час</option>
<option value='$day'>Сутки</option>
<option value='$week'>Неделя</option>
<option value='$month'>Месяц</option>
<option value='$pizda'>Навсегда</option>
</select>
<br/>
Причина: <br/><input type='text' name='prich' value='' /><br/>
ID пользователя: <br/><input type='text' name='id' value='' /><br/>
<input type='submit' name='banned' class='btn' value='Изменить' />
</form>
</div>";
}
include 'foot.php';
?>
</body>
</html>
<?
}

?>