<?

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';
$zn=mysql_fetch_array(mysql_query("select * from `znachki` where `id`='".intval($_GET['znachki'])."';"));
$set['title']='Значки Пользователя';



include_once 'sys/inc/thead.php';

title();

err();

aut();


$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_znachki` Where `user_id` ='".intval($_GET['id'])."' "),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if($k_post==0)
{
echo "<div class='p_t'>\n";
echo "Иконок нету";
echo "</div>\n"; 
}
$zna = mysql_query("select * from `user_znachki` Where `user_id` ='".intval($_GET['id'])."' ORDER by `id` DESC LIMIT $start, $set[p_str];"); 
while ($znac = mysql_fetch_array($zna)){
echo "<div class='p_m'><center><img src='$znac[url]' alt='' /></center></div>";
$gu=intval($_GET['id']);
if ($user['level'] >= 4)
{echo "<a href=?delete=$znac[id]&amp;id=$gu;>Удалить</a>";}
}
$zn=intval($_GET['id']);
if ($k_page>1)str("?id=$zn&amp;",$k_page,$page);

if (isset($_GET['delete']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `user_znachki` WHERE `id` = '".intval($_GET['delete'])."'"),0))
{
$item = mysql_fetch_array(mysql_query("SELECT * FROM `user_znachki` WHERE `id` = '".intval($_GET['delete'])."'"));
mysql_query("DELETE FROM `user_znachki` WHERE `id` = '".intval($_GET['delete'])."' LIMIT 1");

msg('Успешно удалено');
}
include_once 'sys/inc/tfoot.php';

?>

