<?php
$title = 'Страница пользователя';
include_once($_SERVER["DOCUMENT_ROOT"].'/php/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
$query = $db->query("SELECT * FROM `users` WHERE `id`='".$_GET['id']."'");
if($query->num_rows == 0){
	header('location:/main');
}
$us = $query->fetch_assoc();
?>
<div class="container theme-showcase" role="main">
	<div class="jumbotron">

		<h1>Страница пользователя <?=output($us['name'])?> <?=output($us['surname'])?></h1>
		<?if(!file_exists($_SERVER["DOCUMENT_ROOT"].'/files/images/avatars/'.$us['id'].'.jpg')){
			?>
			<img src="/files/images/avatars/no_avatar.png" width="30%" height="30%">
			<?
		}else{
			?>
			<center><img src="/files/images/avatars/<?=$us['id']?>.jpg"  width="140" height="140" class="img-circle"></center>
			<?
		}?>
	</div>
</div>

<?
include_once($_SERVER["DOCUMENT_ROOT"].'/php/style/foot.php');
?>