Файл: donat.php
Строк: 206
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Пополнить счет';
include($path.'files/core.php');
if(isset($_GET['new_pay']))
{
$kol=mysql_real_escape_string($_POST['sum']);
$time=time()+3600;
mysql_query("INSERT INTO `payments` SET
`id`='',
`usr`='".$udata['id']."',
`sum`='".$kol."',
`time`='".$time."'
");
$id=mysql_insert_id();
$sum=$kol*2.5;
$merchant_id='152661';
$order_amount=$sum;
$secret_word='1u713l1n';
$sig=md5($merchant_id.':'.$order_amount.':'.$secret_word.':'.$id);
header('location: http://www.free-kassa.ru/merchant/cash.php?m=152661&oa='.$sum.'&o='.$id.'&s='.$sig.'&lang=ru');exit;
}
if(isset($_GET['clear']))
{
$payement=mysql_query("SELECT * FROM `payments` WHERE `usr`='".$udata['id']."' and `status`='0'");
$num=mysql_num_rows($payement);
if($num!=0){
mysql_query("DELETE FROM `payments` WHERE `usr`='".$udata['id']."' and `status`='0'");
}
header('location: ?');exit;
}
if(isset($_GET['obmen']))
{
if($_POST['kol']>0)
{
$kol=round(htmlspecialchars($_POST['kol']));
if($udata['jem']>=$kol)
{
if($udata['vip_exp']<100)
{$vip_z=50;}
elseif($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$vip_z=100;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$vip_z=150;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$vip_z=200;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$vip_z=250;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$vip_z=350;}
elseif($udata['vip_exp']>=5000){$vip_z=550;}
$mon=$udata['money']+($vip_z*$kol);
$j=$udata['jem']-$kol;
mysql_query("UPDATE `users` SET `money`='".$mon."', `jem`='".$j."' WHERE `id`='".$udata['id']."'");
mysql_query("INSERT INTO `user_log` SET
`usr`='".$udata['id']."',
`text`='Вы успешно обменяли жемчуг на золото.'
");
}
}
header('location: ?');exit;
}
include($path.'files/head.php');
include($path.'files/zag.php');
echo '<table width=100%>
<tr>
<td width=35%>
<a href=game.php><div style="background: #882222; border-radius: 7px 0 0 7px" class="m p bts bbs brs bls" align=center>Главная</div></a>
</td><td>';
echo '<a href=?><div class="line bts brs bls bbs p m" style="border-radius: 0 7px 7px 0">
<font color=#ffffff>Пополнить Счет
</font>
</div></a></td></tr></table>';
echo '<div class="bat bts brs bls bbs p">';
echo '<div style="background: #000000;" class="p m bts bbs brs bls">
<img src=img/main/e30.png> Купив жемчуг вы сможете купить множество различных вещей которые помогут вам в ваших приключениях!<br>
</div>';
echo '<center><div style="background-color: #ebe2cf;border: 2px solid #785b37; border-radius: 8px 8px 0 0; box-shadow: 1px 1px 2px 0 #303030;margin: 3px; overflow: hidden; width: 290px;font-size:12px;color:#000">
<div style=" background-color: #755c3a;
color: #edad3c;
padding: 5px;
text-align: center;
text-shadow: 1px 1px 1px #303030, 0 0 6px #fd0;">Покупка через Free-Kassa</div>
<form method="POST" action="?new_pay">
<table width=100% style="margin-top:3px; margin-bottom:3px"><tr><td width=75% align=center>
Введите кол-во <img src=img/main/13.png><input type="text" value="0" default="0" name="sum" size="2" style="padding:4px">
</td><td>
<input type="submit" value="Пополнить" style="background-color: #6aa436; padding:4px; width:95%;
border-radius: 7px;
box-shadow: rgba(255,255,255,.4) 0 1px 0, inset rgba(255,255,255,.4) 0 1px 0;
text-shadow: #addc7e 0 1px 0;
color: #141b0d;
border: 1px solid #485f45;
cursor: pointer;
font-size: 12px;
background: -webkit-gradient(linear,left top,left bottom,from(#8dc059),to(#6aa436));
background: -webkit-linear-gradient(top,#8dc059,#6aa436);"></td></tr></table>
</form>
<div style="background:#941; padding:2px">Стоимость <img src=img/main/13.png>1 = 2.5 рубля</div>
<div style="background-color: #cab083;border-top: 1px solid #8d8f91;color: green;font-size: 16px;line-height: 25px;margin-top: -2px;padding: 0;text-align: center;text-shadow: 0 0 2px #c1ebb7;">Бронзовый Бонус:</div>
<img src=img/main/e30.png> Купив <img src=img/main/p13.png>10 -
<img src=img/main/e28.png> Бонус <img src=img/main/p13.png>1
<div style="background-color: #cab083;border-top: 1px solid #8d8f91;color: green;font-size: 16px;line-height: 25px;margin-top: -2px;padding: 0;text-align: center;text-shadow: 0 0 2px #c1ebb7;">Серебрянный Бонус:</div>
<img src=img/main/e30.png> Купив <img src=img/main/p13.png>50 -
<img src=img/main/e28.png> Бонус <img src=img/main/p13.png>7
<div style="background-color: #cab083;border-top: 1px solid #8d8f91;color: green;font-size: 16px;line-height: 25px;margin-top: -2px;padding: 0;text-align: center;text-shadow: 0 0 2px #c1ebb7;">Золотой Бонус:</div>
<img src=img/main/e30.png> Купив <img src=img/main/p13.png>100 -
<img src=img/main/e28.png> Бонус <img src=img/main/p13.png>20
<div style="background-color: #cab083;border-top: 1px solid #8d8f91;color: green;font-size: 16px;line-height: 25px;margin-top: -2px;padding: 0;text-align: center;text-shadow: 0 0 2px #c1ebb7;">Платиновый Бонус:</div>
<img src=img/main/e30.png> Купив <img src=img/main/p13.png>250 -
<img src=img/main/e28.png> Бонус <img src=img/main/p13.png>65
<div style="background-color: #cab083;border-top: 1px solid #8d8f91;color: green;font-size: 16px;line-height: 25px;margin-top: -2px;padding: 0;text-align: center;text-shadow: 0 0 2px #c1ebb7;">Алмазный Бонус:</div>
<img src=img/main/e30.png> Купив <img src=img/main/p13.png>500 -
<img src=img/main/e28.png> Бонус <img src=img/main/p13.png>150
</div></center>';
$payement=mysql_query("SELECT * FROM `payments` WHERE `usr`='".$udata['id']."' and `status`='0'");
$num=mysql_num_rows($payement);
if($num!=0){
$pay=mysql_fetch_array($payement);
$id=$pay['id'];
$sum=$pay['sum']*2.5;
$text='Покупка '.$pay['sum'].' жемчуга';
}
$m_shop = '825940162';
$m_orderid = $id;
$m_amount = number_format($sum, 2, '.', '');
$m_curr = 'RUB';
$m_desc = base64_encode($text);
$m_key = 'bZDeUDMkUcaDf96';
$arHash = array(
$m_shop,
$m_orderid,
$m_amount,
$m_curr,
$m_desc
);
$arHash[] = $m_key;
$sign = strtoupper(hash('sha256', implode(':', $arHash)));
/*
*/
echo '<hr>';
if($udata['vip_exp']<100)
{$vip_z=50;}
elseif($udata['vip_exp']>=100 and $udata['vip_exp']<250)
{$vip_z=100;}
elseif($udata['vip_exp']>=250 and $udata['vip_exp']<500)
{$vip_z=150;}
elseif($udata['vip_exp']>=500 and $udata['vip_exp']<1300)
{$vip_z=200;}
elseif($udata['vip_exp']>=1300 and $udata['vip_exp']<2500)
{$vip_z=250;}
elseif($udata['vip_exp']>=2500 and $udata['vip_exp']<5000)
{$vip_z=350;}
elseif($udata['vip_exp']>=5000){$vip_z=550;}
echo '<img src=img/main/e30.png> <font color=#f90><b>Курс обмена</b></font>: <img src=img/main/p13.png>1 = <img src=img/main/p5.png>'.$vip_z.'<br>';
echo '<form action=?obmen method=POST>
Кол-во жемчуга: <input type="number" value="0" default="0" name="kol" size="2" style="padding:4px; width:20%"><br>
<center><input type=submit value="Обменять"></center>
</form>';
echo '</div></div>';
include('files/down.php');
?>