<?php
require ($_SERVER['DOCUMENT_ROOT'].'/core/sys.php');
print_r($_SESSION);
$id = abs(intval($_SESSION['wapkassa']));
$summa = abs($_POST['MNM_PRICE']);
$time = abs(intval($_POST['MNM_TIME_PAY']));
$pay = $db->prepare('SELECT * FROM `pay` WHERE `id` = ?');
$pay -> execute([$id]);
$pay = $pay -> fetch(PDO :: FETCH_ASSOC);
$client = $db->prepare('SELECT * FROM `platform` WHERE `id` = ?');
$client -> execute([$pay['platform']]);
$client = $client -> fetch(PDO :: FETCH_ASSOC);
if(isset($_GET['url'])) header('Location: '.$client['error']); 
else header('Location: '.$client['url']); 

unset($_SESSION['wapkassa']);
exit;