<?
if(isset($_GET['atom'])){
if(isset($_GET['ends'])){
mysql_query("UPDATE `kolhoz_user` SET `atom` = '".($ku['atom']=1)."' WHERE `id` = '$ku[id]'");
header("Location:?safe&atom");
}


if(isset($_GET['cll'])){
echo "<div class='event'><h1>Подтверждение</h1></div><div class='content'><div class='block'><ul class='block'><li><span class='title'>Вы уверены?</span></li><li class='pt'><img alt='' width='16' height='16' src='img/icons/tick.png'> <a href='?safe&atom&cll&ends'><span> Да, подтверждаю</span></a></li><li><img alt='' width='16' height='16' src='img/icons/cross.png'> <a href='?safe&atom'><span> Нет, отказываюсь</span></a></li></ul></div>";
include_once 'inc/foot.php';
}


if(isset($_GET['ur_atom'])){echo '<div class="event"><h1>Подтверждение</h1></div><div class="content"><ul class="block"><li><span class="title">Вы уверены?</span></li><li class="pt"><img alt="" width="16" height="16" src="img/icons/tick.png"> <a href="?safe&atom&ok"><span>Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="img/icons/cross.png"> <a href="?safe&atom"><span>Нет, отказываюсь</span></a></li></ul>';
include_once 'inc/foot.php';}
if(isset($_GET['en'])){echo '<div class="event"><h1>Подтверждение</h1></div><div class="content"><ul class="block"><li><span class="title">Вы уверены?</span></li><li class="pt"><img alt="" width="16" height="16" src="img/icons/tick.png"> <a href="?safe&atom&pl"><span>Да, подтверждаю</span></a></li><li><img alt="" width="16" height="16" src="img/icons/cross.png"> <a href="?safe&atom"><span>Нет, отказываюсь</span></a></li></ul>';
include_once 'inc/foot.php';}
echo "<div class='event'><h1>Энергоатом</h1></div>";
if(isset($_SESSION['energ'])){echo "<div class='block'><center><font color='green'>Уровень успешно повышен!</font></center></div>";
unset($_SESSION['energ']);}
if(isset($_SESSION['energa'])){echo "<div class='block'><center><font color='green'>Энергия успешно куплена!</font></center></div>";
unset($_SESSION['energa']);}
echo "<div class='block'><font color='darkorange'>Чем выше уровень атома тем больше он дает энергии.</font></div>";
if(isset($_GET['cena'])){
echo "<div class='block'><img width='14' height='14' src='safe/img/1.png' alt='o'> = <b><span class='small minor'>100%</span></b><img src='safe/img/energy.png' alt='o'> (Стандарт)<br/>
<img width='14' height='14' src='safe/img/2.png' alt='o'> = <b><span class='small minor'>200%</span></b><img src='safe/img/energy.png' alt='o'> (Цена: <font color='violet'>20</font><img width='14' height='14' src='img/icons/zkl.png' alt='o'>)<br/>
<img width='14' height='14' src='safe/img/3.png' alt='o'> = <b><span class='small minor'>300%</span></b><img src='safe/img/energy.png' alt='o'> (Цена: <font color='violet'>30</font><img width='14' height='14' src='img/icons/zkl.png' alt='o'>)<br/>
<img width='14' height='14' src='safe/img/4.png' alt='o'> = <b><span class='small minor'>400%</span></b><img src='safe/img/energy.png' alt='o'> (Цена: <font color='violet'>40</font><img width='14' height='14' src='img/icons/zkl.png' alt='o'>)<br/>
<img width='14' height='14' src='safe/img/5.png' alt='o'> = <b><span class='small minor'>500%</span></b><img src='safe/img/energy.png' alt='o'> (Цена: <font color='violet'>50</font><img width='14' height='14' src='img/icons/zkl.png' alt='o'>)<br/>
<img width='14' height='14' src='safe/img/5x5.png' alt='o'> = <b><span class='small minor'>1000%</span></b><img src='safe/img/energy.png' alt='o'> (Цена: <font color='violet'>90</font><img width='14' height='14' src='img/icons/zkl.png' alt='o'>)</div><div class='xr'></div><div class='block'>* Цены указаны за уровни.</div><div class='xr'></div>";
include_once 'inc/foot.php';
}
echo "<div class='block'><img width='16' height='16' src='safe/img/icon_atom.png' alt='o'> <span class='small minor'>Уровень атома:</span> ";
if ($ku['atom'] == 1){echo "<img width='14' height='14' src='safe/img/1.png' alt='o'> (<a href='?safe&atom&ur_atom'><img src='safe/img/up.png' alt='o'></a>)";}
if ($ku['atom'] == 2){echo "<img width='14' height='14' src='safe/img/2.png' alt='o'> (<a href='?safe&atom&ur_atom'><img src='safe/img/up.png' alt='o'></a>)";}
if ($ku['atom'] == 3){echo "<img width='14' height='14' src='safe/img/3.png' alt='o'> (<a href='?safe&atom&ur_atom'><img src='safe/img/up.png' alt='o'></a>)";}
if ($ku['atom'] == 4){echo "<img width='14' height='14' src='safe/img/4.png' alt='o'> (<a href='?safe&atom&ur_atom'><img src='safe/img/up.png' alt='o'></a>)";}
if ($ku['atom'] == 5){echo "<img width='14' height='14' src='safe/img/5.png' alt='o'> (<a href='?safe&atom&ur_atom'><img src='safe/img/up.png' alt='o'></a>)";}
if ($ku['atom'] == 6){echo "<img width='14' height='14' src='safe/img/5x5.png' alt='o'>";}
echo "</div>";
if ($ku['atom'] == 1){
$energo=100;
$cena=20;
$ur=2;
$cen=200;
}
if ($ku['atom'] == 2){
$energo=200;
$cena=30;
$ur=3;
$cen=400;
}
if ($ku['atom'] == 3){
$energo=300;
$cena=40;
$ur=4;
$cen=600;
}
if ($ku['atom'] == 4){
$energo=400;
$cena=50;
$ur=5;
$cen=800;
}
if ($ku['atom'] == 5){
$energo=500;
$cena=90;
$ur=6;
$cen=1000;
}
if ($ku['atom'] == 6){
$energo=1000;
$cen=1500;
}
echo "<div class='block'><img src='safe/img/energy.png' alt='o'> <span class='small minor'>У вас энергии:</span> <img src='safe/img/energy.png' alt='o'><b>".$ku['energy']."%</b></div><div class='block'><img src='img/icons/ruby.png' alt='o'> <a href='?safe&atom&en'>Пополнить</a> <span class='small minor'>до</span> <img src='safe/img/energy.png' alt='o'><b>".$energo."%</b> <span class='small minor'>(</span><img src='img/icons/ruby.png' alt='o'><b>".$cen."</b><span class='small minor'>)</span></div>";
if(isset($_GET['ok']))
{
if($ku['zkl']<$cena)
{
$_SESSION['no_zkl']=$cena-$ku['zkl'];
header("Location:?safe&atom");
exit;
}
mysql_query("UPDATE `kolhoz_user` SET `zkl` = '".($ku['zkl']-$cena)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `atom` = '".($ku['atom']=$ur)."' WHERE `id` = '$ku[id]'");
$_SESSION['energ']=1;
header("Location:?safe&atom");
exit;
}
if(isset($_GET['pl'])){
if($ku['rubies']<$cen){
$_SESSION['no_rubies']=$cen-$ku['rubies'];
header("Location:?safe&atom");
exit;
}
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$cen)."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `energy` = '".($ku['energy']=$energo)."' WHERE `id` = '$ku[id]'");
$_SESSION['energa']=1;
header("Location:?safe&atom");
exit;
}
if ($ku['atom'] >= 1)echo "<div class='block'><img width='16' height='16' src='safe/img/del.png' alt='o'> <a href='?safe&atom&&cll'>Сбросить уровни</a> <span class='small minor'>(до: <img width='14' height='14' src='safe/img/1.png' alt='o'>)</span></div>";
echo "<a href='?safe&atom&cena'><div class='block'><center><img width='16' height='16' src='safe/img/icon_atom.png' alt='o'> Цены на уровни</center></div></a>";
include_once 'inc/foot.php';
}
?>