<?php
	
	/**
	 *	@project	Битва титанов
	 *	@author		ЭKZO
	 */
	
	include_once __DIR__ . '/include/common.php';
	include_once __DIR__ . '/include/general_functions.php';
	include_once __DIR__ . '/include/utils.php';	
	include_once __DIR__ . '/include/user.php';
	
	if ( ! @$user)
			redirect('/');
	
	$params	=	[];
	$params['title']	=	'Ресурсы';
	
	ob_start();
	
	include_once __DIR__ . '/include/header.php';
	
	$sack	=	get_user_sack(
		$user['id']
	);
	
	?>
	<ul class='menu'>
	<?php
	for	(
			$i	=	1;
			$i	<	10;
			++$i
		)
	{
		
		if ($sack[ $i ] != 0)
		{
		
			$name	=	get_sack(
				$i
			);
			$desc	=	get_sack_desc(
				$i
			);
		
	?>
		<li>
			<table>
			<tr>
			<td style='vertical-align:	top;'><img src='/images/res/<?=$i?>.png' alt='' /></td>
			<td style='vertical-align:	top;'>
			
			<?=$name?>, <span class='c_blue'><?=$sack[ $i ]?></span> шт.<br />
			<span class='small c_grey'><?=$desc?></span>
				
			</td>
			</tr></table>
		</li>
	<?php
			
		}
		
	}
	?>
	</ul>
	<?php
	
	include_once __DIR__ . '/include/footer.php';
	
	setContentType('text/html; charset=UTF-8');
	render(
		__DIR__ . '/include/template.php',
		ob_get_clean(),
		(array) $params
	);
	
	?>