<?php

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

	# core

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

	# meta

	$title = 'GOLD сайты » Мобильные WAP сайты';
	$description = system::check($config['description']);
	$keywords = system::check($config['keywords']);
	$tl = 'GOLD сайты ';

	# adm

	system::adm();

	# post

	if (isset($_POST['CMFS'])):

	$id  = system::abs($_POST['id']);
	$day = system::abs($_POST['day']);
	$CK  = system::check($_POST['CK']);	

	if (cache_pf::ch($id) === true):

	if ($user['CK'] == $CK):	

	$gold = time() + 86400 * $day;

	DB :: $dbh -> query("UPDATE platforms SET gold = ? WHERE id = ? LIMIT 1;", array($gold,$id));	

	cache_pf::save($id);			

	system::header('?','Успешно',1);

	# error
	
	else: system::header('?','Ошибка, возможно вам подкинули эту ссылку'); endif;	
	else: system::header('?','Ошибка, ID не найден'); endif;	

	endif;

	# head

	require_once ( head );

	echo '
	<div class="touch">
	<form method="post" >
	<input type="hidden" name="CK" value = "'.$user['CK'].'">
	ID cайта:<br>
	<input name="id" type="text" size="5" value=""><br>
	Количество дней:<br>
	<input name="day" type="text" size="5" value=""><br>
	<input name="CMFS" type="submit" value="Сохранить">
	</form>
	</div>
	<a href="'.site.'admin/gold" class="touch">« Назад</a>
	';

	# foot

	require_once ( foot ) ;

?>