<?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(isset($_GET['id'])){
		$id = abs((int)$_GET['id']);
		$info = mysql_query("SELECT * FROM `users` WHERE id='".$id."'") or die(mysql_error());
		$row_info = mysql_fetch_array($info);
}
include 'head.php';
?>
<div class="title">Гараж - <?=$row_info['nick']?></div>
<div class='menu'>
<div class="boldtext"><b>Статус</b></div>: <?=$row_info['mystatus']?>
</div>
<div class="mono">
	<img src="<?=$row_info['car']?>" alt="<?=$row_info['carname']?>" />
</div>
<div class="mono">
<div class="newser">
<span style="float:right">
<a href="<?=$row_info['avatar']?>"><img src='<?=$row_info['avatar']?>' width='80' height='80' alt='' style='padding:0;border-radius:56px;-moz-border-radius:56px;-webkit-border-radius:56px;-khtml-border-radius:56px;'/></a></span>
Статус: <b><div class="boldtext"><?=$row_info['status']?></div></b><br/>
Основное авто: <div class="boldtext"><b><?=$row_info['carname']?></b></div><br />
Скорость: <div class="boldtext"><b><?=$row_info['speed']?> л.с</b></div><br />
Рейтинг: <div class="boldtext"><b><?=$row_info['raiting']?></b></div><br />
Уровень: <div class="boldtext"><b><?=$row_info['level']?></b></div><br />
Серебро: <div class="boldtext"><b><?=$row_info['money']?></b></div><br />
Золото: <div class="boldtext"><b><?=$row_info['money2']?></b></div><br />
Рефералов: <div class="boldtext"><b><?=$row_info['refback']?></b></div><br />

</div>
<table class="wdt">
<tr>
<td><center><a href="cars.php?id=<?=$row_info['id']?>"><input type="submit" value="Авто гонщика" class="btn2" /></a></center></td>
</tr>
<tr><td><center><a href="mail.php?id=<?=$row_info['id']?>"><input type="submit" value="Написать в почту" class="btn2" /></a></center></td></tr>
</table>
<?php
if($data_user['status'] != "Гонщик" && $data_user['status'] != "VIP" && $data_user['status'] != "Помощник"){
$row_infoid = $id;
		echo "<center><br/><a href='adm_panel/index.php?users&edit=$row_infoid'>Редактировать профиль</a></center>";
	}else{
}
?>
</div>
</p>
</div>
</div>
<?
}
include 'foot.php';
?>