<?
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();
if (isset($user))
{
$p = (isset($_GET['p'])) ? htmlspecialchars($_GET['p']) : null;



switch($p){

case 'send_gifts':


include_once '../sys/inc/thead.php';
$set['title']='Отправить подарок'; // заголовок страницы
title();
aut();


$id = intval($_GET['id']);
$ud = intval($_GET['ud']);

///////////////////////////////
echo "<div class=\"menu\">\n";
echo "Отправить подарок<br />\n";
echo "</div>\n";
///////////////////////////////
//$usearch=$ank[id];
//if (isset($_SESSION['usearch']))$usearch=$_SESSION['usearch'];
//if (isset($_POST['usearch']))$usearch=$_POST['usearch'];
//if ($usearch==NULL)
//unset($_SESSION['usearch']);else
//$_SESSION['usearch']=$usearch;
//$usearch=ereg_replace("( ){1,}","",$usearch);
if (isset($_GET['go'])){
$curr=date("d.m.y / H:i");
$balls =50;
$msg=$_POST['msg'];
$ank['id']=$ud;
if($ank['id']==0){
msg ('Пользователь не найден :(');
}else{if (isset($user) & $user['balls']<=$balls){
msg ('У Вас недостаточно баллов,необходимо минимум 50!');}else{
mysql_query("UPDATE `user` SET `balls` = '".($user['balls']-$balls)."' WHERE `id` = '$user[id]' LIMIT 1",$db);
////////////////////
//mysql_query("UPDATE `user` SET `balls` = '".($ank['balls']+$balls)."' WHERE `id` = '$ank[id]' LIMIT 1");
////////////////////
//mysql_query("INSERT INTO `fin_oper` (`user`, `oper`, `time`, `cena`) values('$user[id]', 'Отправлен подарок $balls KM для $ank[nick]', '$time', '$balls')",$db);
////////////////////
mysql_query("INSERT INTO `gifts` (`id_user`, `ot_id`, `text`, `time`, `id_gifts`) values('$ank[id]', '$user[id]', '$msg', '$time', '$id')",$db);
////////////////////
$msgrat="К вам пришёл подарок от [red]$user[nick][/red]! ";
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('$user[id]', '$ank[id]', '$msgrat', '$time')");
msg ('Отправка подарка успешно завершена');
}}
include_once '../sys/inc/tfoot.php';}

echo"<img src='/gifts/".$id.".png' alt='' class='icon'/>";

echo "<form method=\"post\" action=\"gifts.php?p=send_gifts&id=".$_GET['id']."&ud=".$_GET['ud']."&go\">";
echo "Текст сообщения:<br/>";
echo "<input type=\"text\" name=\"msg\" value=\"\"/><br />\r\n";
echo "<input type=\"submit\" value=\"Подарить\" />";
echo "</form>\n";
echo'<small>С вашего счета будет снято 50 баллов</small>';

include_once '../sys/inc/tfoot.php';

break;
}
$pod = (isset($_GET['pod'])) ? htmlspecialchars($_GET['pod']) : null;

$set['title']='Подарки'; 
include_once '../sys/inc/thead.php';
title();
aut();
echo "<div class=\"menu\">\n";
echo "Отправить подарок<br />\n";
echo "</div>\n";
$ud = intval($_GET['ud']);
switch($pod) {

case '1':
echo "<div class=\"rowup\">\n";

echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=24&ud=$ud\">Роза</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=25&ud=$ud\">Ваза с цветами</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=26&ud=$ud\">Клубничка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=5&ud=$ud\">Банан</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=6&ud=$ud\">Вкусный тортик</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=7&ud=$ud\">Деньги</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=9&ud=$ud\">Малиновый коктель</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=10&ud=$ud\">Гусеница</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=30&ud=$ud\">Букет цветов</a><br/>"; 
echo "</div>\n";
echo "<a href=\"gifts.php?pod=2&ud=$ud\">2</a>
<a href=\"gifts.php?pod=3&ud=$ud\">3</a>
<a href=\"gifts.php?pod=4&ud=$ud\">4</a>
<a href=\"gifts.php?pod=5&ud=$ud\">5</a>
<a href=\"gifts.php?pod=6&ud=$ud\">6</a>
<a href=\"gifts.php?pod=7&ud=$ud\">7</a><br/>";

break;
case '2':
echo "<div class=\"rowup\">\n";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=11&ud=$ud\">Подсолнух в очках</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=12&ud=$ud\">Бaбёр</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=13&ud=$ud\">Цыплёнок</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=14&ud=$ud\">Воздушный шарик 'Сердце'</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=15&ud=$ud\">Супер животное</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=16&ud=$ud\">Жирафик</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=17&ud=$ud\">Жёлтая Утка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=18&ud=$ud\">Соска</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=19&ud=$ud\">Кольца</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=20&ud=$ud\">Ландыши</a><br/>"; 
echo "</div>\n";
echo "<a href=\"gifts.php?pod=3&ud=$ud\">Дальше</a> |\n";
echo "<a href=\"gifts.php?pod=1&ud=$ud\">Назад</a><br/>\n";
break;
case '3':
echo "<div class=\"rowup\">\n";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=21&ud=$ud\">Бoкал пива</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=22&ud=$ud\">Зелёная Шляпа</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=23&ud=$ud\">Веселая корова</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=2&ud=$ud\">День Победы</a><br/>";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=3&ud=$ud\">Скунс</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=4&ud=$ud\">Туалетная бумага</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=27&ud=$ud\">Танк</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=28&ud=$ud\">Щит отечества</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=29&ud=$ud\">Медаль</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=8&ud=$ud\">Стринги</a><br/>"; 
echo "</div>\n";
echo "<a href=\"gifts.php?pod=4&ud=$ud\">Дальше</a> |\n";
echo "<a href=\"gifts.php?pod=2&ud=$ud\">Назад</a><br/>\n";
break;
case '4':
echo "<div class=\"rowup\">\n";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=31&ud=$ud\">Сердечко под замком</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=32&ud=$ud\">Милая спящая панда</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=33&ud=$ud\">Рубиновое сердце</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=34&ud=$ud\">Собачка в колпаке</a><br/>";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=35&ud=$ud\">МегаМозг</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=36&ud=$ud\">Влюблённые зайчики</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=37&ud=$ud\">Барашек</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=38&ud=$ud\">Лисичка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=39&ud=$ud\">Большой свадебный торт</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=40&ud=$ud\">Мечтающая мышка</a><br/>"; 
echo "</div>\n";
echo "<a href=\"gifts.php?pod=5&ud=$ud\">Дальше</a> |\n";
echo "<a href=\"gifts.php?pod=3&ud=$ud\">Назад</a><br/>\n";
break;
case '5':

echo "<div class=\"rowup\">\n";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=41&ud=$ud\">Овечка с шариками</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=42&ud=$ud\">Копилка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=43&ud=$ud\">Мамонтёнок</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=44&ud=$ud\">Спящий кот</a><br/>";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=45&ud=$ud\">Подарок в упаковке</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=46&ud=$ud\">Золотой бычок</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=47&ud=$ud\">Мешок с подарками</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=48&ud=$ud\">Оленёнок</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=49&ud=$ud\">Бодрая коровка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=50&ud=$ud\">Колпак знаний</a><br/>"; 
echo "</div>\n";
echo "<a href=\"gifts.php?pod=6&ud=$ud\">Дальше</a> |\n";
echo "<a href=\"gifts.php?pod=4&ud=$ud\">Назад</a><br/>\n";
break;
case '6':
echo "<div class=\"rowup\">\n";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=51&ud=$ud\">Весёлый бегемот</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=52&ud=$ud\">Сундук с сокровищами</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=53&ud=$ud\">Белка с орешком</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=54&ud=$ud\">Колпак волшебника</a><br/>";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=55&ud=$ud\">Огромный подарок</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=56&ud=$ud\">Неразлучные сердца</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=57&ud=$ud\">Шампанское в ведре со льдом</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=58&ud=$ud\">Толстая жадная мышь</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=59&ud=$ud\">Котёнок с бантиком</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=60&ud=$ud\">Футбольный мяч</a><br/>"; 
echo "</div>\n";
echo "<a href=\"gifts.php?pod=7&ud=$ud\">Дальше</a> |\n";
echo "<a href=\"gifts.php?pod=5&ud=$ud\">Назад</a><br/>\n";
break;

case '7':

echo "<div class=\"rowup\">\n";
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=107&ud=$ud\">Зажигалка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=208&ud=$ud\">Пушка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=215&ud=$ud\">Корзина яец</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=210&ud=$ud\">Часы с кукушкой</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=194&ud=$ud\">Сумочка</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=167&ud=$ud\">Самовар</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=162&ud=$ud\">Сейф</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=150&ud=$ud\">Наручные часы</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=136&ud=$ud\">Кукла</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=626&ud=$ud\">Кольцо с диамонтом</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=270&ud=$ud\">Пухнастик</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=81&ud=$ud\">Бита</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=118&ud=$ud\">Мороженное</a><br/>"; 
echo "<img src='/img/tabor/ico.gif' alt=''> <a href=\"gifts.php?p=send_gifts&id=182&ud=$ud\">Вместе </a><br/>"; 
echo "</div>\n";
break;



}}else{
include_once '../sys/inc/thead.php';
$set['title']='Отправить подарок'; // заголовок страницы
title();
aut();
echo'Зарегайся для начала!';}
include_once '../sys/inc/tfoot.php';
?>