<?php

	# mark core  v1.0
    # author Drk in
	# date 24.10.19 	

	# core

	require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );

	$SIGN = md5(FREE_ID.':'.$_REQUEST['AMOUNT'].':'.FREE_KEY.':'.$_REQUEST['MERCHANT_ORDER_ID']);

	if ($SIGN == $_REQUEST['SIGN']):

	$price =  $_REQUEST['us_day'] * PRICE;
	
	if ($price == $_REQUEST['AMOUNT']):

	if (cache_pf::ch($_REQUEST['us_id']) === true):	

	$gold = time() + 86400 * $_REQUEST['us_day'];

	DB :: $dbh -> query("UPDATE platforms SET gold = ? WHERE id = ? LIMIT 1;", array($gold,$_REQUEST['us_id']));	
		
	cache_pf::save($_REQUEST['us_id']);		

	die('YES');   	

	# error
	
	else: die('ERROR1');  endif;	
	else: die('ERROR2');  endif;
	else: die('ERROR3');  endif;
?>