Файл: test.kolhozu.keo.su/inc/converter.php
Строк: 145
<?
$count1=3;
$count1=floor($ku['dostig']/5)+$count1;
if(isset($flowerbed_act))$count1=$count1+$flowerbed_act;
if(isset($pit3_act))$count1=$count1+$pit3_act;
if(isset($neon_act))$count1=$count1+$neon_act;
$time_rub=floor(86400/$count1);
$time1=$time-$ku['time_obmen'];
$col_rub=floor($time1/$time_rub);
if($col_rub>$count1)$col_rub=$count1;
if(isset($_GET['all']))
{
$need_mcr=10000*$col_rub;
if($ku['money']>=$need_mcr)
{
if($col_rub>=$count1)
{
mysql_query("UPDATE `kolhoz_user` SET `time_obmen` = '$time', `rubies` = '".($ku['rubies']+$col_rub)."', `money` = '".($ku['money']-$need_mcr)."' WHERE `id` = '$ku[id]'");
}
else mysql_query("UPDATE `kolhoz_user` SET `time_obmen` = '".($ku['time_obmen']+($col_rub*$time_rub))."', `rubies` = '".($ku['rubies']+$col_rub)."', `money` = '".($ku['money']-$need_mcr)."' WHERE `id` = '$ku[id]'");
}
else $_SESSION['no_money']=$need_mcr-$ku['money'];
header("Location:?converter");
exit;
}
elseif(isset($_GET['one']))
{
$need_mcr=10000;
if($ku['money']>=$need_mcr)
{
if($col_rub>=$count1)
{
$tkt=$col_rub-1;
$tt=$time_rub*$tkt;
$ttt=$time-$tt;
mysql_query("UPDATE `kolhoz_user` SET `time_obmen` = '$ttt', `rubies` = '".($ku['rubies']+1)."', `money` = '".($ku['money']-$need_mcr)."' WHERE `id` = '$ku[id]'");
}
else mysql_query("UPDATE `kolhoz_user` SET `time_obmen` = '".($ku['time_obmen']+$time_rub)."', `rubies` = '".($ku['rubies']+1)."', `money` = '".($ku['money']-$need_mcr)."' WHERE `id` = '$ku[id]'");
}
else $_SESSION['no_money']=$need_mcr-$ku['money'];
header("Location:?converter");
exit;
}
elseif(isset($_GET['money_one']))
{
$need_mcr=1;
$mok=1000;
if($ku['rubies']>=$need_mcr)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$need_mcr)."', `money` = '".($ku['money']+$mok)."' WHERE `id` = '$ku[id]'");
}
else $_SESSION['no_rubies']=$need_mcr-$ku['rubies'];
header("Location:?converter");
exit;
}
elseif(isset($_GET['money_all']))
{
$need_mcr=10;
$mok=10000;
if($ku['rubies']>=$need_mcr)
{
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$need_mcr)."', `money` = '".($ku['money']+$mok)."' WHERE `id` = '$ku[id]'");
}
else $_SESSION['no_rubies']=$need_mcr-$ku['rubies'];
header("Location:?converter");
exit;
}
?>
<div class="event"><h1>Обменный пункт</h1></div>
<div class="content">
<div class="block">
<div class='small ptm'>
<div style='padding-top:4px'>
<div class='event' style='height:2px'>
<div class='eventlight' style='height:2px;width:".rand(75,95)."%'>
</div>
</div>
<ul class='block'>
<li>
<h3>Обменять на доллары</h3>
<ul>
<li>
<img width="16" height="16" src="images/icons/convert.png" alt="o"> <a href="?converter&money_one">Обменять</a> <img width="16" height="16" src="images/icons/ruby.png" alt="o"> 1 евро
на <img width="16" height="16" src="images/icons/money.png" alt="o"> 1000 долларов.
</li>
<li>
<img width="16" height="16" src="images/icons/convert.png" alt="o"> <a href="?converter&money_all">Обменять</a> <img width="16" height="16" src="images/icons/ruby.png" alt="o"> 10 евро на <img width="16" height="16" src="images/icons/money.png" alt="o"> 10000 долларов.
</li>
</ul>
<h3>Обменять на евро</h3>
<div>
<img width="16" height="16" src="images/icons/convert.png" alt="o">
<?
if($col_rub>0)echo "<a href='?converter&one'>Обменять</a> <img width='16' height='16' src='images/icons/money.png' alt='o'> 10000 долларов на <img width='16' height='16' src='images/icons/ruby.png' alt='o'> 1 евро.<br></div><div><img width='16' height='16' src='images/icons/convert.png' alt='o'> <a href='?converter&all'>Обменять</a> <img width='16' height='16' src='images/icons/money.png' alt='o'> <span>".($col_rub*10000)."</span> долларов на <img width='16' height='16' src='images/icons/ruby.png' alt='o'> <span>$col_rub</span> евро.<br/>";
else echo "<span>Обменять</span> <img width='16' height='16' src='images/icons/money.png' alt='o'> 10000 долларов на <img width='16' height='16' src='images/icons/ruby.png' alt='o'> 1 евро.<br>";
echo "</div>
<div class='minor ptm'>Сейчас доступно к обмену:
<span class='title'>$col_rub</span> / <span class='title'>$count1</span>";
include_once 'inc/foot.php';
?>
(зависит от количества достижений и <a href='?shop=flowerbed'>Копилки</a>).
</div>
</div>