Вход Регистрация
Файл: vfermu.ru/sys/collective/cash.php
Строк: 330
<?
if(isset($_GET['ratting']))include_once 'sys/collective/cash_rat.php';

echo 
"<div class='event'><title>".hsc($ct['name'])." / Касса</title></div>";

if(isset(
$_GET['rubies'])){
if(isset(
$_GET['type']) && in_array(intval($_GET['type']),array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17))){
$rubies=intval($_GET['type']);
if(
$rubies==1){$cena=1;}
if(
$rubies==2){$cena=10;}
if(
$rubies==3){$cena=50;}
if(
$rubies==4){$cena=100;}
if(
$rubies==5){$cena=500;}
if(
$rubies==6){$cena=1000;}
if(
$rubies==7){$cena=5000;}
if(
$rubies==8){$cena=10000;}
if(
$rubies==9){$cena=100000;}
if(
$rubies==10){$cena=500000;}
if(
$rubies==11){$cena=1000000;}
if(
$rubies==12){$cena=5000000;}
if(
$rubies==13){$cena=10000000;}
if(
$rubies==14){$cena=50000000;}
if(
$rubies==15){$cena=100000000;}
if(
$rubies==16){$cena=500000000000;}
if(
$rubies==17){$cena=1000000000000;}

if(
$ku['rubies']>=$cena){
mysql_query("UPDATE `farm_collective` SET `rubies` = '".($ct['rubies']+$cena)."', `rubies_cop` = '".($ct['rubies_cop']+$cena)."' WHERE `id` = '$ct[id]'");
mysql_query("UPDATE `farm_collective_user` SET `rubies` = '".($mcu['rubies']+$cena)."',`rubies_week` = '".($mcu['rubies_week']+$cena)."' WHERE `id_user` = '$ku[id]'") or die (mysql_error());
$ct['rubies']=$ct['rubies']+$cena;
mysql_query("UPDATE `farm_user` SET `rubies` = '".($ku['rubies']-$cena)."' WHERE `id` = '$ku[id]'");
$ku['rubies']=$ku['rubies']-$cena;
header("Location:/collective-$ct[id]/cash/rubies");
}else 
no_rubies($cena-$ku['rubies']);}}



if(isset(
$_GET['money'])){
if(isset(
$_GET['type']) && in_array(intval($_GET['type']),array(1,2,3,4,5,6,7,8,9,10,11,12,13,14))){
$money=intval($_GET['type']);
if(
$money==1){$cena=1000;}
if(
$money==2){$cena=5000;}
if(
$money==3){$cena=10000;}
if(
$money==4){$cena=50000;}
if(
$money==5){$cena=100000;}
if(
$money==6){$cena=500000;}
if(
$money==7){$cena=1000000;}
if(
$money==8){$cena=5000000;}
if(
$money==9){$cena=10000000;}
if(
$money==10){$cena=50000000;}
if(
$money==11){$cena=100000000;}
if(
$money==12){$cena=1000000000000000000;}
if(
$money==13){$cena=10000000000000000000;}
if(
$money==14){$cena=100000000000000000000;}

if(
$ku['money']>=$cena){

mysql_query("UPDATE `farm_collective_user` SET `money` = '".($mcu['money']+$cena)."' WHERE `id_user` = '$ku[id]'");
mysql_query("UPDATE `farm_collective` SET `money` = '".($ct['money']+$cena)."' WHERE `id` = '$ct[id]'");
$ct['money']=$ct['money']+$cena;
mysql_query("UPDATE `farm_user` SET `money` = '".($ku['money']-$cena)."' WHERE `id` = '$ku[id]'");
$ku['money']=$ku['money']-$cena;
header("Location:/collective-$ct[id]/cash/money");}else no_money($money-$ku['money']);}}


echo 
"<title>Касса</title>";

echo
"<div class='content'><div class='block'>";

echo
"<ul class='minor'>";
echo
"<li>Алмазы: <span class='title'><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers($ct['rubies'])."</span></span></li>";
echo
"<li>Монеты: <span class='title'><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers($ct['money'])."</span></span></li>";
echo
"</ul>";
echo
"<li><a href='/collective-$ct[id]/cash".(!isset($_GET['rubies'])?"/rubies":null)."'>Внести в кассу <img width='16' height='16' src='/images/icons/ruby.png' alt='*'> алмазы</a></li>";
echo
"<li><a href='/collective-$ct[id]/cash".(!isset($_GET['my_rubies'])?"/my_rubies":null)."'>Внести в кассу <img width='16' height='16' src='/images/icons/ruby.png' alt='*'> алмазы</a> (вручную)</li>";

if(isset(
$_GET['my_rubies'])){
if(isset(
$_POST['rubies_submit']) && ($_POST['rubies_submit'])!=NULL){
$a floor($_POST['rubies_number']);
if((
$a 0)||($a == '')){$a 0;}
if(
$ku['rubies']>=$a){
mysql_query("UPDATE `farm_collective` SET `rubies` = '".($ct['rubies']+$a)."', `rubies_cop` = '".($ct['rubies_cop']+$a)."' WHERE `id` = '$ct[id]'");
mysql_query("UPDATE `farm_collective_user` SET `rubies` = '".($mcu['rubies']+$a)."',`rubies_week` = '".($mcu['rubies_week']+$a)."' WHERE `id_user` = '$ku[id]'") or die (mysql_error());
$ct['rubies']=$ct['rubies']+$a;
mysql_query("UPDATE `farm_user` SET `rubies` = '".($ku['rubies']-$a)."' WHERE `id` = '$ku[id]'");
$ku['rubies']=$ku['rubies']-$a;
header("Location:/collective-$ct[id]/cash/my_rubies");}else no_rubies($a-$ku['rubies']);}
echo
"<form method='post'>";
echo
"<div class='pt'>Алмазы: <input type='text' size='25' name='rubies_number' value=''> <input type='submit' name='rubies_submit' value='OK'></div>";
echo
"</form>";}

if(isset(
$_GET['rubies'])){
echo
"<ul class='minor'>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/rubies/type-1'><span><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers(1)."</span></span> рубин</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/rubies/type-2'><span><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers(10)."</span></span> алмазов</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/rubies/type-3'><span><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers(50)."</span></span> алмазов</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/rubies/type-4'><span><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers(100)."</span></span> алмазов</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/rubies/type-5'><span><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers(500)."</span></span> алмазов</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/rubies/type-6'><span><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers(1000)."</span></span> алмазов</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/rubies/type-7'><span><img width='16' height='16' src='/images/icons/ruby.png' alt='*'> <span class='title'>".numbers(5000)."</span></span> алмазов</a></li>";
echo
"</ul>";}



echo
"<li><a href='/collective-$ct[id]/cash".(!isset($_GET['money'])?"/money":null)."'>Внести в кассу <img width='16' height='16' src='/images/icons/money.png' alt='*'> монеты</a></li>";
echo
"<li><a href='/collective-$ct[id]/cash".(!isset($_GET['my_money'])?"/my_money":null)."'>Внести в кассу <img width='16' height='16' src='/images/icons/money.png' alt='*'> монеты</a> (вручную)</li>";
if(isset(
$_GET['my_money'])){
if(isset(
$_POST['money_submit']) && ($_POST['money_submit'])!=NULL){
$a floor($_POST['money_number']);
if((
$a 0)||($a == '')){$a 0;}
if(
$ku['money']>=$a){
mysql_query("UPDATE `farm_collective_user` SET `money` = '".($mcu['money']+$a)."' WHERE `id_user` = '$ku[id]'");
mysql_query("UPDATE `farm_collective` SET `money` = '".($ct['money']+$a)."' WHERE `id` = '$ct[id]'");
$ct['money']=$ct['money']+$a;
mysql_query("UPDATE `farm_user` SET `money` = '".($ku['money']-$a)."' WHERE `id` = '$ku[id]'");
$ku['money']=$ku['money']-$a;
header("Location:/collective-$ct[id]/cash/my_money");}else no_money($a-$ku['money']);}
echo
"<form method='post'>";
echo
"<div class='pt'>Монеты: <input type='text' size='25' name='money_number' value=''> <input type='submit' name='money_submit' value='OK'></div>";
echo
"</form>";}


if(isset(
$_GET['money'])){
echo
"<ul class='minor'>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-1'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(1000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-2'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(5000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-3'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(10000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-4'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(50000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-5'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(100000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-6'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(500000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-7'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(1000000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-8'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(5000000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-9'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(10000000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-10'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(50000000)."</span></span> монет</a></li>";
echo
"<li>Внести <a href='/collective-$ct[id]/cash/money/type-11'><span><img width='16' height='16' src='/images/icons/money.png' alt='*'> <span class='title'>".numbers(100000000)."</span></span> монет</a></li>";
echo
"</ul>";
}

echo
"<h3>Плательщики</h3>";

echo
"<li><a href='/collective-$ct[id]/cash/ratting/rubies'>Рейтинг по взносу <img width='16' height='16' src='/images/icons/ruby.png' alt='*'> алмазов за всё время</a></li>";
echo
"<li><a href='/collective-$ct[id]/cash/ratting/rubies_week'>Рейтинг по взносу <img width='16' height='16' src='/images/icons/clock.png' alt='*'> алмазов за неделю</a></li>";
echo
"<li><a href='/collective-$ct[id]/cash/ratting/money'>Рейтинг по взносу <img width='16' height='16' src='/images/icons/money.png' alt='*'> монет</a></li>";
echo
"</div>";
include_once 
'sys/other/foot.php';
?>
Онлайн: 1
Реклама