Файл: shop/purchase/index.php
Строк: 30
<?
require_once('../../core/index.php');
require_once('../../core/func.php');
avt();
$title='Пополнить рубины';
require_once('../../design/head.php');
include_once 'config.php';
if (isset($_POST['rubin'])){
if (!isset($_POST['rubin']) || $_POST['rubin']<=0) {$err='Введите корректно сумму';}
if(!isset($err)){
$summa=$_POST['rubin']*$price;
$data=file_get_contents('http://worldkassa.ru/user/oplata.php?id_shop='.$id_shop.'&summa='.$summa.'&hash='.$hash);
if (is_numeric($data)){
request("INSERT INTO `worldkassa` (`id_user`, `id_bill`, `time`, `summa`) values(?, ?, ?, ?)", array($user['id'], $data, time(), $summa));
header("Location: http://worldkassa.ru/user/oplata.php?uniq=".$data);
exit();
}else{
$_SESSION['msg']=$data;
header('Location?');
}
}else{
$_SESSION['msg']=$err;
header('Location?');
}}
echo '<div class="h1">Введите количество рубинов<br/>
<form action="?" method="post">
<input name="rubin" type="text" placeholder="Рубинов"/><br/>
<input type="submit" value="Пополнить"/>
</form></div>
<div class="h1"><small><font color="red">***</font> 1 рубин = '.$price.' RUB</small></div>';
require_once('../../design/foot.php');
?>