<?
if($ku['id']==1){
if(isset($_SESSION['oblom'])){echo "<div class='block'><center><font color='#DC143C'>Это не Ваш подарок!</font></center></div>"; unset($_SESSION['oblom']);}
if(isset($_SESSION['uspex'])){echo "<div class='block'><center><font color='#7FFF00'>Поздравляем, Вы нашли свой подарок!</font></center></div>"; unset($_SESSION['uspex']);}



if(isset($_GET['ccc'])){
mysql_query("UPDATE `kolhoz_user` SET `novgod` = '".($ku['novgod']=0)."' WHERE `id` = '$ku[id]'");
}



echo '<div class="event"><h1>Наша елка</h1></div>';
echo "<div class='block'>";






if($ku['turnir']==0){echo "<div class='block'><center><font color='#DC143C'>У Вас не хватает снежинок!</font></center></div>";}

echo "<div class='block'><center><img src='elka.gif' alt='o'></center></div>";
$ng = strtotime('05.01.2014 00:00:00');
$res = $ng-time();
echo '<div class="block">Елка простоит еще: <br/> ' . intval($res/(3600*24)) . ' дней, ' . intval(($res%(3600*24))/3600) . ' часов, ' . intval((($res%(3600*24))%3600)/60) . ' минут, ' . (($res%(3600*24))%3600)%60 . ' секунд</div>';

echo '<div class="feedback"><b><center><font color="#CC9988">Д</font><font color="#886677">о</font><font color="#EE0000">б</font><font color="#777700">р</font><font color="#333311">о</font> <font color="#7733DD">п</font><font color="#FF99EE">о</font><font color="#119999">ж</font><font color="#BB22EE">а</font><font color="#4466DD">л</font><font color="#777766">о</font><font color="#6699BB">в</font><font color="#11AA55">а</font><font color="#22AA22">т</font><font color="#AA5522">ь</font> 
<font color="#AA2211">н</font><font color="#552266">а</font> 
<font color="#551144">е</font><font color="#889933">л</font><font color="#669977">к</font><font color="#EE77EE">у</font><font color="#5599DD">!</font></center></b>';

echo "<font color='#98FB98'>Наш *<b>Дедушка мороз</b>* под елку, каждому игроку положил <b>подарочек!</b> но чтобы его забрать, его нужно найти среди других подарков..<br/>Дело в том, что, наш <b>Дедушка мороз</b> забыл подписать кому какой подарок и поместил все подарки в один мешок!</font></div>";
if ($ku['novgod']==0)echo "<div class='feedback'><font color='violet'>Количество ваших подарков:</font> <b>1</b>";
if ($ku['novgod']==1)echo "<div class='feedback'><font color='violet'>Количество ваших подарков:</font> <b>0</b>";

echo "<br/><font color='violet'>Дано попыток:</font> <b>Неограничено</b><br/><font color='violet'>Цена за попытку:</font> <b>10</b><img width='15' height='15' src='img/snewka.png'><br/><font color='violet'>В подарках есть:</font> 
<img width='16' height='16' src='img/icons/zkl.png' alt='o'>,<img width='16' height='16' src='img/icons/ruby.png' alt='o'>,<img width='16' height='16' src='img/icons/money.png' alt='o'>,<img width='16' height='16' src='img/euro.png' alt='o'><font color='tomato'></font></div>";



if($ku['level']<30)
{
echo "<div class='content'>";echo "<div class='block'>";
echo'<img src="img/icons/owibochka.gif" alt="*"> Елка доступна с 30-го уровня!';
include_once 'inc/foot.php';
echo "</div></div>";
exit;
}



if ($ku['novgod']==0){
echo "<font color='#33FFCC'><b>Найди свой подарочек:</b></font>";
echo "<div class='block'>";
//============================================
//Начисление в сумме от и до
$kluch=rand(50,100);//ключи: от и до (k)
$k=$kluch;
$rub=rand(10000000,20000000);//рубины: от и до (r)
$r=$rub;
$mon=rand(20000000000,30000000000);//монеты: от и до (m)
$m=$mon;
$euro=rand(50,100);//евро: от и до (e)
$e=$euro;
//=======================

$cc=rand(999,99999);
//Неудача
if($ku['turnir']>=10){
if(isset($_GET['iskat'])){
mysql_query("UPDATE `kolhoz_user` SET `turnir` = '".($ku['turnir']-10)."' WHERE `id` = '$ku[id]'");
$_SESSION['oblom']=1;
header("Location:?elka&$cc");
}
}



//Удача
if(isset($_GET['mygiftsok'])){
mysql_query("UPDATE `kolhoz_user` SET `zkl` = '".($ku['zkl']+$k)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']+$r)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `money` = '".($ku['money']+$m)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `euro` = '".($ku['euro']+$e)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `novgod` = '".($ku['novgod']=1)."' WHERE `id` = '$ku[id]'");
$_SESSION['uspex']=1;
echo "<center>В Вашем подарке Вы нашли:</center>
<b>1.</b> <font color='violet'>$k</font><img width='16' height='16' src='img/icons/zkl.png' alt='o'>
<br/><b>2.</b> <font color='violet'>$r</font><img width='16' height='16' src='img/icons/ruby.png' alt='o'>
<br/><b>3.</b> <font color='violet'>$m</font><img width='16' height='16' src='img/icons/money.png' alt='o'>
<br/><b>4.</b> <font color='violet'>$e</font><img width='16' height='16' src='img/euro.png' alt='o'><br/>
<center>Администрация Искрине поздравляет вас с Новым 2014 годом! :)</center>";
include_once 'inc/foot.php';
}



echo "<center>";
//Рондомим удачу
$go=rand(1,15);
{
if($go == 1 || $go == 2 || $go == 13 || $go == 11 || $go == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/1.png' alt='o'></a> ";
}
elseif($go == 6 || $go == 15 || $go == 8 || $go == 9 || $go == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/2.png' alt='o'></a> ";
}
elseif($go == 4 || $go == 12 || $go == 3 || $go == 14 || $go == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/3.png' alt='o'></a> ";
}
}
//=====
$gos=rand(1,15);
{
if($gos== 1 || $gos == 2 || $gos == 13 || $gos == 11 || $gos == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/4.png' alt='o'></a> ";
}
elseif($gos == 6 || $gos == 15 || $gos == 8 || $gos == 9 || $gos == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/5.png' alt='o'></a> ";
}
elseif($gos == 4 || $gos == 12 || $gos== 3 || $gos == 14 || $gos == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/6.png' alt='o'></a> ";
}
}
//=====
$goq=rand(1,15);
{
if($goq == 1 || $goq == 2 || $goq == 13 || $goq == 11 || $goq == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/7.png' alt='o'></a> ";
}
elseif($goq == 6 || $goq == 15 || $goq == 8 || $goq == 9 || $goq == 10){
echo "<a href='?elka&mygiftsok&$cc'><img width='100' height='100' src='img/podarok_2014/8.png' alt='o'></a> ";//подарок
}
elseif($goq == 4 || $goq == 12 || $goq == 3 || $goq == 14 || $goq == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/9.png' alt='o'></a> ";
}
}
//=====
$gow=rand(1,15);
{
if($gow == 1 || $gow == 2 || $gow == 13 || $gow == 11 || $gow == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/10.png' alt='o'></a> ";
}
elseif($gow == 6 || $gow == 15 || $gow == 8 || $gow == 9 || $gow == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/11.png' alt='o'></a> ";
}
elseif($gow == 4 || $gow == 12 || $gow == 3 || $gow == 14 || $gow == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/12.png' alt='o'></a> ";
}
}
//=====
$goe=rand(1,15);
{
if($goe == 1 || $goe == 2 || $goe == 13 || $goe == 11 || $goe == 5){
echo "<a href='?elka&mygiftsok&$cc'><img width='100' height='100' src='img/podarok_2014/13.png' alt='o'></a> ";//подарок
}
elseif($goe == 6 || $goe == 15 || $goe == 8 || $goe == 9 || $goe == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/14.png' alt='o'></a> ";
}
elseif($goe == 4 || $goe == 12 || $goe == 3 || $goe == 14 || $goe == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/15.png' alt='o'></a> ";
}
}
//=====
$gor=rand(1,15);
{
if($gor == 1 || $gor == 2 || $gor == 13 || $gor == 11 || $gor == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/16.png' alt='o'></a> ";
}
elseif($gor == 6 || $gor == 15 || $gor == 8 || $gor == 9 || $gor == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/17.png' alt='o'></a> ";
}
elseif($gor == 4 || $gor == 12 || $gor == 3 || $gor == 14 || $gor == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/18.png' alt='o'></a> ";
}
}
//=====
$got=rand(1,15);
{
if($got == 1 || $got == 2 || $got == 13 || $got == 11 || $got == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/19.png' alt='o'></a> ";
}
elseif($got == 6 || $got == 15 || $got == 8 || $got == 9 || $got == 10){
echo "<a href='?elka&mygiftsok&$cc'><img width='100' height='100' src='img/podarok_2014/20.png' alt='o'></a> ";//ПОДАРОК
}
elseif($got == 4 || $got == 12 || $got == 3 || $got == 14 || $got == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/21.png' alt='o'></a> ";
}
}
//=====
$goy=rand(1,15);
{
if($goy == 1 || $goy == 2 || $goy == 13 || $goy == 11 || $goy == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/22.png' alt='o'></a> ";
}
elseif($goy == 6 || $goy == 15 || $goy == 8 || $goy == 9 || $goy == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/23.png' alt='o'></a> ";
}
elseif($goy == 4 || $goy == 12 || $goy == 3 || $goy == 14 || $goy == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/24.png' alt='o'></a> ";
}
}
//=====
$goa=rand(1,15);
{
if($goa == 1 || $goa == 2 || $goa == 13 || $goa == 11 || $goa == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/25.png' alt='o'></a> ";
}
elseif($goa == 6 || $goa == 15 || $goa == 8 || $goa == 9 || $goa == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/26.png' alt='o'></a> ";
}
elseif($goa == 4 || $goa == 12 || $goa == 3 || $goa == 14 || $goa == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/27.png' alt='o'></a> ";
}
}
//=====
$goz=rand(1,15);
{
if($goz == 1 || $goz == 2 || $goz == 13 || $goz == 11 || $goz == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/28.png' alt='o'></a> ";
}
elseif($goz == 6 || $goz == 15 || $goz == 8 || $goz == 9 || $goz == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/29.png' alt='o'></a> ";
}
elseif($goz == 4 || $goz == 12 || $goz == 3 || $goz == 14 || $goz == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/30.png' alt='o'></a> ";
}
}
//=====
$gox=rand(1,15);
{
if($gox == 1 || $gox == 2 || $gox == 13 || $gox == 11 || $gox == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/31.png' alt='o'></a> ";
}
elseif($gox == 6 || $gox == 15 || $gox == 8 || $gox == 9 || $gox == 10){
echo "<a href='?elka&mygiftsok&$cc'><img width='100' height='100' src='img/podarok_2014/32.png' alt='o'></a> ";//подарок
}
elseif($gox == 4 || $gox == 12 || $gox == 3 || $gox == 14 || $gox == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/33.png' alt='o'></a> ";
}
}
//=====
$goc=rand(1,15);
{
if($goc == 1 || $goc == 2 || $goc == 13 || $goc == 11 || $goc == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/34.png' alt='o'></a> ";
}
elseif($goc == 6 || $goc == 15 || $goc == 8 || $goc == 9 || $goc == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/35.png' alt='o'></a> ";
}
elseif($goc == 4 || $goc == 12 || $goc == 3 || $goc == 14 || $goc == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/36.png' alt='o'></a> ";
}
}
//=====
$gov=rand(1,15);
{
if($gov == 1 || $gov == 2 || $gov == 13 || $gov == 11 || $gov == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/37.png' alt='o'></a> ";
}
elseif($gov == 6 || $gov == 15 || $gov == 8 || $gov == 9 || $gov == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/38.png' alt='o'></a> ";
}
elseif($gov == 4 || $gov == 12 || $gov == 3 || $gov == 14 || $gov == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/39.png' alt='o'></a> ";
}
}
//====
$gob=rand(1,15);
{
if($gob == 1 || $gob == 2 || $gob == 13 || $gob == 11 || $gob == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/40.png' alt='o'></a> ";
}
elseif($gob == 6 || $gob == 15 || $gob == 8 || $gob == 9 || $gob == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/41.png' alt='o'></a> ";
}
elseif($gob == 4 || $gob == 12 || $gob == 3 || $gob == 14 || $gob == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/42.png' alt='o'></a> ";
}
}
//=====
$gon=rand(1,15);
{
if($gon == 1 || $gon == 2 || $gon == 13 || $gon == 11 || $gon == 5){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/43.png' alt='o'></a> ";
}
elseif($gon == 6 || $gon == 15 || $gon == 8 || $gon == 9 || $gon == 10){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/44.png' alt='o'></a> ";
}
elseif($gon == 4 || $gon == 12 || $gon == 3 || $gon == 14 || $gon == 7){
echo "<a href='?elka&iskat&$cc'><img width='100' height='100' src='img/podarok_2014/45.png' alt='o'></a> ";
}
}
}
else
echo "<font color='green'><b>Вы уже нашли свой подарок!</b></font>";
echo '</center></div>';
echo '</div>';
}else
echo "<div class='block'>Елка закрыта...</div>";


include_once 'inc/foot.php';
?>