Файл: test.zfarm.mobi/mystyleuser/shopudobr.php
Строк: 39
<?php
/////////////////////////
/*
Author MyStyle ZomBi.Biz
Год 2013 Права предоставлены автору Шехову Виталию Александровичу
http://vk.com/online_user
*/
/////////////////////////
if(isset($_GET['linkgood']) && num($_GET['linkgood'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_udob` WHERE `id` = '".num($_GET['linkgood'])."'"),0)!=0){
$fer = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_udob` WHERE `id` = '".num($_GET['linkgood'])."'"));
$need=$fer['money'];
if($user['money']>=$need){
$col = $user['s_redpack_small']+$fer['col'];
$cash = $user['money']-$fer['money'];
mysql_query("UPDATE `mystyle_user` SET `s_redpack_small` = '".$col."', `money` = '".$cash."' WHERE `id` = '".$user['id']."' LIMIT 1");
///////// Лог Пользователя ///// By MyStyle
$text = 'Удобрения куплены';
$_SESSION['msg'] = $text;
header("Location: ./");
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>
<td>Цена</td>
</tr>
<tr class="blueSecColor textshadow">';
$user['set'] = 10;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_udob`"),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_udob` LIMIT $start, $user[set]");
while($post=mysql_fetch_array($q))
{
$sr = $start+1;
echo '<tr class="blueSecColor textshadow">
<td><a class="btnp" href="?linkredpacksmallshop&linkgood='.$post['id'].'">Купить</a><br /><br /></td>
<td><img width="25" height="25" src="images/s_redpack_small.png" alt="" /> '.$post['col'].'</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 class="center pt12 pb18">';
if ($k_page>1)str("?linkredpacksmallshop&",$k_page,$page);
echo '</div>';
?>