<?
include '../system/common.php';
include '../system/functions.php';
include '../system/user.php';
if(!isset($user)){header('location: /');exit;}
$title = 'Покупка золота';
include '../system/h.php';
include 'sett.php';

?>
<div class="title">Покупка золота </div>
<?
if(isset($_GET['gold']))
{
$gold = intval($_GET['gold']);
if (isset($wk_cena_gold[$gold]))
{
if($gold == '100'){$bonus=5;}
if($gold == '500'){$bonus=50;}
if($gold == '1000'){$bonus=150;}
if($gold == '5000'){$bonus=1000;}
if($gold == '10000'){$bonus=2500;}
?>
<div class="empty_block">
<table> <tbody><tr>
<td width="13%">
<img src="/images/ico/pay/<?=$gold?>.png">
</td><td> 
<img src="/images/ico/png/gold.png" alt="*"/><b> <?=$gold?> Золота</b> <br>
<img src="/images/ico/png/gold.png" alt="*"/><b>+<?=$bonus?> в подарок</b>
</td></tr>
</tbody></table>
	
<form method="POST" action="https://wapkassa.ru/merchant/oplata.php">
<input type="hidden" name="WK_PAYMENT_SITE" value="<?=wk_id?>">
<input type="hidden" name="WK_PAYMENT_AMOUNT" value="<?=wk_summ($wk_cena_gold[$gold])?>">
<input type="hidden" name="WK_PAYMENT_COMM" value="Покупка золота ID <?=$user['id']?>">
<input type="hidden" name="WK_PAYMENT_HASH" value="<?=strtoupper(hash("sha256",wk_id.wk_summ($wk_cena_gold[$gold]).wk_code))?>">
<input type="hidden" name="WK_PAYMENT_USER" value="<?=$user['id']?>">
<input type="hidden" name="WK_PAYMENT_TOVAR" value="gold">
<input type="hidden" name="WK_PAYMENT_COUNT" value="<?=$gold?>">
<center><input type="submit" class="button" value="Перейти к оплате"></center>
</form>
</div><div class="line"></div>
<?
include '../system/f.php';
exit;
}
}

foreach($wk_cena_gold as $key => $value)
{
if($key == '100'){$bonus=5;}
if($key == '500'){$bonus=50;}
if($key == '1000'){$bonus=150;}
if($key == '5000'){$bonus=1000;}
if($key == '10000'){$bonus=2500;}
echo'  <div class="empty_block">
<table> <tbody><tr>
<td width="13%">
<img src="/images/ico/pay/'.$key.'.png">
</td><td> 
<img src="/images/ico/png/gold.png" alt="*"/><b>'.$key.' Золота</b> <br>
<img src="/images/ico/png/gold.png" alt="*"/><b>+'.$bonus.' в подарок</b>
</td></tr>
</tbody></table>
<form action="/paywk/?gold='.$key.'" method="post">
<center><input class="button" type="submit" value="'.$value.' руб. "/></center>
</form>
</div><div class="line"></div>';


}

include '../system/f.php';
?>
