<?
if(isset($_GET['rating']) && (isset($_GET['rubies']) || isset($_GET['money'])))include_once 'inc/mr_rat_ct.php';
echo "<div class='event'><h1><a href='/collective-$ct[id]'>".hsc($ct['name'])."</a> / Касса</h1></div>";
if(isset($_GET['rubies']) && in_array(intval($_GET['rubies']),array(1,10,50,100,500,1000,5000,10000)))
{
$rubies=intval($_GET['rubies']);
if($ku['rubies']>=$rubies)
{
mysql_query("UPDATE `kolhoz_collective` SET `rubies` = '".($ct['rubies']+$rubies)."', `rubies_cop` = '".($ct['rubies_cop']+$rubies)."' WHERE `id` = '$ct[id]'");
mysql_query("UPDATE `kolhoz_collective_user` SET `rubies` = '".($mcu['rubies']+$rubies)."',`rubies_week` = '".($mcu['rubies_week']+$rubies)."' WHERE `id_user` = '$ku[id]'") or die (mysql_error());
$ct['rubies']=$ct['rubies']+$rubies;
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$rubies)."' WHERE `id` = '$ku[id]'");
$ku['rubies']=$ku['rubies']-$rubies;
header("Location:/collective-$ct[id]/cash/rubies/".passgen());
}
else no_rubies($rubies-$ku['rubies']);
}
elseif(isset($_GET['money']) && in_array(intval($_GET['money']),array(1000,5000,10000,50000,100000,500000,1000000,5000000,10000000,50000000,100000000)))
{
$money=intval($_GET['money']);
if($ku['money']>=$money)
{
mysql_query("UPDATE `kolhoz_collective_user` SET `money` = '".($mcu['money']+$money)."' WHERE `id_user` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_collective` SET `money` = '".($ct['money']+$money)."' WHERE `id` = '$ct[id]'");
$ct['money']=$ct['money']+$money;
mysql_query("UPDATE `kolhoz_user` SET `money` = '".($ku['money']-$money)."' WHERE `id` = '$ku[id]'");
$ku['money']=$ku['money']-$money;
header("Location:/collective-$ct[id]/cash/money/".passgen());
}
else no_money($money-$ku['money']);
}
?>
<div class="content">
<div class="block">
<div>
<ul class="minor">
<li>Рубины: <span class="title"><img width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title"><? echo $ct['rubies'];?></span></span></li>
<li>Монеты: <span class="title"><img width="16" height="16" src="images/icons/money.png" alt="*">
<span class="title"><? echo $ct['money'];?></span></span></li>
</ul>
</div>
<div>
<h3>Взносы</h3>
<ul>
<li><a href="/collective-<? echo $ct['id']."/cash".(!isset($_GET['rubies'])?"/rubies":null)."";?>">Внести в кассу <img width="16" height="16" src="images/icons/ruby.png" alt="*"> рубины</a><br>
<?
if(isset($_GET['rubies']))
{
?>
<div class="block">
<ul class="minor">
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-1/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">1</span></span> рубин</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-10/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">10</span></span> рубинов</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-50/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">50</span></span> рубинов</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-100/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">100</span></span> рубинов</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-500/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">500</span></span> рубинов</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-1000/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">1 тыс.</span></span>
рубинов</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-5000/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">5 тыс.</span></span> рубинов</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/rubies-10000/cash"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="*"> <span class="title">10 тыс.</span></span> рубинов</a></li>

</ul>
</div>
<?
}
?>
</li>
<li><a href="/collective-<? echo $ct['id']."/cash".(!isset($_GET['money'])?"/money":null)."";?>">Внести в кассу <img width="16" height="16" src="images/icons/money.png" alt="*"> монеты</a><br>
<?
if(isset($_GET['money']))
{
?>
<div class="block">
<ul class="minor">
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-1000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">1 тыс.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-5000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">5 тыс.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-10000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">10 тыс.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-50000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">50 тыс.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-100000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">100 тыс.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-500000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">500 тыс.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-1000000/cash"><span><img width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">1 млн.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-5000000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">5 млн.</span></span> монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-10000000/cash"><span><img
width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">10 млн.</span></span> монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-50000000/cash"><span><img width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">50 млн.</span></span>
монет</a></li>
<li>Внести <a href="/collective-<? echo $ct['id'];?>/money-100000000/cash"><span><img width="16" height="16" src="images/icons/money.png" alt="*"> <span class="title">100 млн.</span></span> монет</a></li>
</ul>
</div>
<?
}
?>
</li>
</ul>
</div>
<div>
<h3>Плательщики</h3>
<ul>
<li><a href="/collective-<? echo $ct['id'];?>/cash/rating/rubies">Рейтинг по взносу <img width="16" height="16" src="images/icons/ruby.png" alt="*"> рубинов за всё время</a></li>
<li><a href="/collective-<? echo $ct['id'];?>/cash/rating/rubies/week">Рейтинг по взносу <img width="16" height="16" src="images/icons/clock.png" alt="*"> рубинов за неделю</a></li>
<li><a href="/collective-<? echo $ct['id'];?>/cash/rating/money">Рейтинг по взносу <img width="16" height="16" src="images/icons/money.png" alt="*"> монет</a></li>
</ul>
</div>
</div>
<? include_once 'inc/foot.php';?>