<?


require_once ('system/func.php');
auth(); // Закроем от не авторизованных


$title = 'Подарки';
require_once ('system/header.php');
echo "<div class='wrapper center'>";



if(isset($_GET['user'])){$user=abs(intval($_GET['user']));}else{$user=1;}
?>
<div class='mb10'></div>
<div class='block_zero'>
<?
if(isset($_GET['tip'])){
$tip=abs(intval($_GET['tip']));
}
if(@$tip > 3  or !isset($_GET['tip']) ){$tip=0;}

$q = mysql_query('SELECT * FROM `prezents` WHERE `tip` = "'.$tip.'" ORDER BY `id` DESC');
 while($row = mysql_fetch_array($q)) {
echo'<a href="/mail/'.$user.'?gift='.$row['id'].'"><img src="/images/gifts/'.$row['img'].'.png" alt=""/></a>';
}
  
  
  

echo'</div></div>
 <div class="mini-line"></div><div class="menuList">
 <div class="main_link">
 <li><a href="?user='.$user.'&tip=0"><img src="/images/gifts/section/romantic.png" alt=""/>Романтика</a></li>
</div>
 <div class="main_link">
 
 <li><a href="?user='.$user.'&tip=1"><img src="/images/gifts/section/friendship.png" alt=""/>Дружба</a></li>
 </div>
 <div class="main_link">
 
 <li><a href="?user='.$user.'&tip=2"><img src="/images/gifts/section/fiesta.png" alt=""/>Праздники</a></li>
 </div>
 <div class="main_link">
 
  <li><a href="?user='.$user.'&tip=3"><img src="/images/gifts/section/sport.png" alt=""/>Спорт</a></li>
 </div><div class="line"></div>
</div>';


?>
