View file gift/index.php

File size: 3.62Kb
<?

	include_once '../../sys/inc/start.php';
	include_once '../../sys/inc/compress.php';
	include_once '../../sys/inc/sess.php';
	include_once '../../sys/inc/home.php';
	include_once '../../sys/inc/settings.php';
	include_once '../../sys/inc/db_connect.php';
	include_once '../../sys/inc/ipua.php';
	include_once '../../sys/inc/fnc.php';
	include_once '../../sys/inc/user.php';
	only_reg();
	
	define ('id', isset( $_GET['id'] ) ? abs(intval($_GET['id'])) : 0);	
	$ank = get_user(id); // 
	
	# создатель || главный админ | админ	

	$admin = ($user['group_access'] == 15 || $user['group_access'] == 9 || $user['group_access'] == 8 ? 0:1);	


	$set['title']="Подарки : $ank[nick]";
	include_once '../../sys/inc/thead.php';
	title();
	aut();
	
	$count = mysql_result(mysql_query("SELECT COUNT(id) FROM `gifts_user` WHERE `id_user` = '$ank[id]'"),0);
	
	
	echo '
	<link rel="stylesheet" href="style.css" type="text/css" />
	<div class="main_bg">
	
	<div class="lc_br wbg font0 relative oh" id="header_path">  
	<a href="/" style="font-size:0;"> <img src="ico/home.png" alt=""> </a>     
	<span class="lc_brw"> <img src="ico/sep.png" alt="" class="lc_br_sep"> 
	<a href="/info.php?id='.$ank['id'].'">'.$ank['nick'].'</a> </span>     
	<span class="lc_brw"> 
	<img src="ico/sep.png" alt="" class="lc_br_sep"> <span class="lc_br_text">
	Подарки</span>
	</span>	
	</div>
	
	<div class="header upcs">      
	<b class="m">Подарки</b> <span class="cnt m">'.$count.'</span> </div>
	
	<div class="wrapper"> 
	<a href="/user/gift/categories.php?id='.$ank['id'].'" class="link -full   blue c-blue      "> 
	<span><img src="ico/gifts_blue.png " alt="" class="m">
	<span class="m">Сделать подарок '.$ank['nick'].'</span>
	</span>  </a>    </div>
	<div class="wrapper"> <div class="list f-c_fll">  
	';
	
	$k_page=k_page($count,$set['p_str']);
	$page=page($k_page);
	$start=$set['p_str']*$page-$set['p_str'];
	$q = mysql_query("SELECT * FROM `gifts_user` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
	
	while ($post = mysql_fetch_assoc($q))
	{
	
	$data = get_user($post['id_ank']);
	
	if ($post['type'] == 0)$avtor  = ''. user::avatar($data['id'],  2).''. user::nick($data['id'], 1, 1, 1).'';	// публичный
	if ($post['type'] == 1)$avtor  = ''.($post['id_user'] == $user['id'] || $admin == 0  ? ''. user::avatar($data['id'],  2).''. user::nick($data['id'], 1, 1, 1).'':' Неизвестный').'';	// личный	
	if ($post['type'] == 2)$avtor  = ''.($admin == 0  ? ''. user::avatar($data['id'],  2).''. user::nick($data['id'], 1, 1, 1).'':' Неизвестный').'';	// Анонимный
	
	echo'
	<div class="block oh relative bord-botm"> 
	<div class="left dot_pic"> 
	<img src="/sys/gift/' . $post['id_gift'] . '.png" alt="" class="p40"></div> 
	<div class="oh">
	<div class="grey right">' . vremja($post['time']) . '</div>'.$avtor.'</div> 
	<div class="pad_t_a"> 
	<a href="/user/gift/gift.php?id=' . $post['id'] . '" class=" full_link"> Подробнее </a> </div> </div>
	';
	
	}
	
	echo'
	</div></div>
	<div id="header_path"> </div>
	<div class="lc_br wbg font0 relative oh" id="header_path">  
	<a href="/" style="font-size:0;"> <img src="ico/home.png" alt=""> </a>     
	<span class="lc_brw"> <img src="ico/sep.png" alt="" class="lc_br_sep"> 
	<a href="/info.php?id='.$ank['id'].'">'.$ank['nick'].'</a> </span>     
	<span class="lc_brw"> 
	<img src="ico/sep.png" alt="" class="lc_br_sep"> <span class="lc_br_text">
	Подарки</span>
	</span>	
	</div>';
	
	include_once '../../sys/inc/tfoot.php';
?>