<?
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)))
{
$rubies=intval($_GET['rubies']);
if($ku['rubies']>=$rubies)
{
mysql_query("UPDATE `kolhoz_collective` SET `rubies` = '".($ct['rubies']+$rubies)."' WHERE `id` = '$ct[id]'");
$ct['rubies']=$ct['rubies']+$rubies;
mysql_query("INSERT INTO `kolhoz_collective_cash` SET `id_user` = '$ku[id]', `id_collective` = '$ct[id]', `count` = '$rubies', `type` = 'rubies', `time` = '$time'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '".($ku['rubies']-$rubies)."' WHERE `id` = '$ku[id]'");
$ku['rubies']=$ku['rubies']-$rubies;
}
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` SET `money` = '".($ct['money']+$money)."' WHERE `id` = '$ct[id]'");
$ct['money']=$ct['money']+$money;
mysql_query("INSERT INTO `kolhoz_collective_cash` SET `id_user` = '$ku[id]', `id_collective` = '$ct[id]', `count` = '$money', `type` = 'money', `time` = '$time'");
mysql_query("UPDATE `kolhoz_user` SET `money` = '".($ku['money']-$money)."' WHERE `id` = '$ku[id]'");
$ku['money']=$ku['money']-$money;
}
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="o"> <span class="title"><? echo $ct['rubies'];?></span></span></li>
<li>Монеты: <span class="title"><img width="16" height="16" src="images/icons/money.png" alt="o">
<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="o"> рубины</a><br>
<?
if(isset($_GET['rubies']))
{
?>
<div class="block">
<ul class="minor">
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&rubies=1"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">1</span></span> рубин</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&rubies=10"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">10</span></span> рубинов</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&rubies=50"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">50</span></span> рубинов</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&rubies=100"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">100</span></span> рубинов</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&rubies=500"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">500</span></span> рубинов</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&rubies=1000"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">1 тыс.</span></span>
рубинов</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&rubies=5000"><span><img
width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">5 тыс.</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="o"> монеты</a><br>
<?
if(isset($_GET['money']))
{
?>
<div class="block">
<ul class="minor">
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=1000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">1 тыс.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=5000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">5 тыс.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=10000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">10 тыс.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=50000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">50 тыс.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=100000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">100 тыс.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=500000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">500 тыс.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=1000000"><span><img width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">1 млн.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=5000000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">5 млн.</span></span> монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=10000000"><span><img
width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">10 млн.</span></span> монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=50000000"><span><img width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title">50 млн.</span></span>
монет</a></li>
<li>Внести <a href="?collective=<? echo $ct['id'];?>&cash&money=100000000"><span><img width="16" height="16" src="images/icons/money.png" alt="o"> <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="o"> рубинов за всё время</a></li>
<li><a href="?collective=<? echo $ct['id'];?>&cash&rating&rubies&week">Рейтинг по взносу <img width="16" height="16" src="images/icons/clock.png" alt="o"> рубинов за неделю</a></li>
<li><a href="?collective=<? echo $ct['id'];?>&cash&rating&money">Рейтинг по взносу <img width="16" height="16" src="images/icons/money.png" alt="o"> монет</a></li>
</ul>
</div>
</div>
<? include_once 'inc/foot.php';?>