Файл: vkolhoze.com/smsbill/sms_rubi.php
Строк: 80
<?
include_once("smsbill.class.php");
include_once("settings_sms.php");
if(isset($_GET['pay']))
{
$serv = hsc($_GET['servid']);
if(!isset($money[$serv]))
{err_game('Ошибка!!!');
include_once 'inc/foot.php';
}else{
$rubi = $money[$serv];
echo "<div class='event'><h1>Покупка $rubi рубинов</h1></div>";
echo "<div class='block content'>";
echo "У вас <img width='16' height='16' src='images/icons/ruby.png' alt='o'><b>$ku[rubies]</b> рубинов<br/>
<span class='title'><b>Оплата по смс</b></span><br/><br/>";
$smsbill = new SMSBill();
$smsbill->setServiceId($serv);
$smsbill->useEncoding($charset);
$smsbill->useHeader('no');
$smsbill->useLang($lang);
$smsbill->useCss('http://'.$_SERVER['HTTP_HOST']);
if (isset($_REQUEST['smsbill_password'])) {
if (!$smsbill->checkPassword($_REQUEST['smsbill_password'])) {
echo"Код указан не верно.";
include_once"inc/foot.php";
exit;
}else{
$kol=$rubi;
if($ku['flowerbed']==11)$bon=round(($kol/100)*25);
if($ku['flowerbed']>=12)$bon=round(($kol/100)*50);
if($ku['flowerbed']==20)$bon=round(($kol/100)*100);
function texi($kol){
$rest = substr("$kol", -1);
if($rest>=1){$tex="рубинов";}
if($kol>=21 and $rest==1){$tex="рубин";}
if($kol>=21 and $rest>=2 and $rest<=4){$tex="рубина";}
if($kol>=21 and $rest>=5){$tex="рубинов";}
if($rest==0){$tex="рубинов";}
return $tex;
}
if(isset($bon))$bontext='Бонус за клумбу: '.$bon.' '.(texi($bon)).'.'; else {$bon=0;$bontext='';}
$text="Получен платеж на Ваш аккаунт: $kol ".(texi($kol)).".
$bontext
Всего зачислено: ".($kol+$bon)." ".(texi($kol+$bon)).".";
///
echo "Оплата заказа $inv_id прошла удачно. $id_user $text";
$sum=$kol+$bon;
mysql_query("UPDATE `kolhoz_user` SET `rubies` = '$ku[rubies]'+'$sum',`action_time`='".(time()+86400)."' WHERE `id` = '$ku[id]' LIMIT 1") or die (mysql_error());
mysql_query("INSERT INTO `kolhoz_mail` SET `id_user` = '$ku[id]', `id_kont` = '0', `msg` = '$text', `time` = '".(time())."', `type` = 'to'") or die (mysql_error());
mysql_query("INSERT INTO `kolhoz_price` SET `id_user` = '$ku[id]', `kol` = '$kol', `bon` = '$bon', `time` = '".(time())."', `kol_all` = '$sum'") or die (mysql_error());
header("Location:/myfarm");
//mysql_query("UPDATE `kolhoz_user` SET `rubies` =`rubies`+ '$rubi' WHERE `id` = '$ku[id]'");
//echo "Вам зачислено ". $rubi ." рубинов.";
include_once"inc/foot.php";
}
}else{
echo $smsbill->getForm();
echo"<span class='title'>Если по каким то причинам вы не получили рубины, то напишите <a href='/user/1'><span class='nickAdmin'>администратору</span></a></span>";
include_once"inc/foot.php";
}
}
}
echo "<div class='event'><h1>Покупка рубинов по sms</h1></div>";
echo "<div class='block content'>";
foreach ($money as $serv_id => $money_val){
echo "<img width='16' height='16' src='images/icons/ruby.png' alt='o'><b>$money_val</b> рубинов <a href='/payment/sms/pay/servid-".$serv_id."'>Купить</a><br />";
}
echo "</div>";
include_once 'inc/foot.php';
?>