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