<?
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';
#####  WWE :-D  #####
if (!isset($user) && !isset($_GET['id'])){header("Location: /index.php?".SID);exit;}
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: /index.php?".SID);exit;}
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[id] LIMIT 1"));
$set['title']='Кинуть снежок в '.$ank['nick'].'';  // заголовок страницы
include_once '../sys/inc/thead.php';
title();
aut();

$bal = 100;

if (isset($user) & $user['balls']<=99)
{
if ($user['pol']==0){echo "Извини <b>красавица,</b> ";} else {echo "<b>Извини братан,</b> ";}
echo "но вам надо <b>100</b> баллов<br/>У вас <b>$user[balls]</b> баллов<br />\n";
}
else
{
if(!isset($err)){
mysql_query("UPDATE `user` SET `balls`=`balls`-$bal WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `user` SET `s_kinyli` = '".($ank['s_kinyli']+1)."' WHERE `id` = '$ank[id]' LIMIT 1",$db);
mysql_query("UPDATE `user` SET `s_kinyl` = '".($user['s_kinyl']+1)."' WHERE `id` = '$user[id]' LIMIT 1");
echo "Вы успешно кинули снежок в <b>$ank[nick]</b><br />";
$msgrat5="[b]$user[nick][/b] кинул в вас снежок.";
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$msgrat5', '$time')");
}
}
echo "<a href=\"/info.php?id=$ank[id]\">Назад</a><br/>";
include_once '../sys/inc/tfoot.php';

?>