Файл: test.zfarm.mobi/msclub/msclubmoneyadd.php
Строк: 58
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_club` WHERE `type` = '".num($user['msclub'])."'"),0)<1){
///////// Лог Пользователя ///// By MyStyle
$text = 'Вас нет в клане';
$_SESSION['msg'] = $text;
header("Location: ./?msclan");
exit;
}else{
if(isset($_GET['msyes']) && num($_GET['msyes'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_cmoney` WHERE `id` = '".num($_GET['msyes'])."'"),0)!=0){
$fer = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_cmoney` WHERE `id` = '".num($_GET['msyes'])."'"));
$club = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_club` WHERE `id` = '".num($user['msclub'])."'"));
$cuser = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_cuser` WHERE `user` = '".num($user['id'])."'"));
$need=$fer['money'];
if($user['money']>=$need){
$col = $club['money']+$fer['col'];
$col2 = $user['money']-$fer['col'];
$col3 = $cuser['money']+$fer['col'];
mysql_query("UPDATE `mystyle_club` SET `money` = '".$col."' WHERE `id` = '".$user['msclub']."' LIMIT 1");
mysql_query("UPDATE `mystyle_user` SET `money` = '".$col2."' WHERE `id` = '".$user['id']."' LIMIT 1");
mysql_query("UPDATE `mystyle_cuser` SET `money` = '".$col3."' WHERE `user` = '".$user['id']."' LIMIT 1");
///////// Лог Пользователя ///// By MyStyle
$text = 'Монеты переведены';
$_SESSION['msg'] = $text;
header("Location: ./?msclub");
exit;
}else{
err_money($need-$user['money']);
}
}
echo '<div class="feedbackPanel">Пополнение монет</div><div>
<div>
<table class="center pt6 pb6" style="margin:0 auto; width: 80%;">
<tr class="whiteBoldLink textshadow">
<td>Действие</td>
<td>Количество</td>
</tr>
<tr class="blueSecColor textshadow">';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_cmoney`"),0);
if ($k_post==0){
}
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_cmoney` LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
echo '<tr class="blueSecColor textshadow">
<td><a class="btnp" href="?msclubmoneyadd&msyes='.$post['id'].'">Пополнить</a><br /><br /></td>
<td><span class="money nobr textshadow"><img width="16" height="16" src="images/zombi/coins.png" alt=""/> <span>'.$post['money'].'</span></td>
</tr>';
$start++;
}
echo '</table></div></div></div>';
echo '<div>
<div class="feedbackPanel">
<div style="text-align: center;">
<div class="fl" style="width: 49%;">
<a class="btn" href="?msclub">
<img width="16" height="16" alt="o" src="/images/icons/tick.png"/>
<span>В клан!</span>
</a>
</div>
<div class="fr" style="width: 49%;">
<a class="btn" href="./">
<img width="16" height="16" alt="o" src="/images/icons/cross.png"/>
<span>На главную!</span>
</a>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>';
echo '<div class="center pt12 pb18">';
if ($k_page>1)str("?msclubmoneyadd&",$k_page,$page);
echo '</div>';
}
?>