View file sdark.mobi/adm_root/skat.php

File size: 745B
<?php

include_once __DIR__ . '../../core/system.php';
$header = 'Выдача сундуков';
include_once __DIR__ . '../../core/head.php';


if ($user['id'] != 1)
{
	header(
		sprintf(
			"Location:%s",
			'/'
			)
		);
	exit;
}


if (isset($_GET['25']))
{
	$result = [];

	$query = mysql_query(
			sprintf(
				"SELECT `id`,`level`,`online` FROM `user` WHERE `online` > '".(time()-846000)."' and `level` > 5"
			)
		);

	while ($data =  mysql_fetch_assoc($query))
	{
		$result[] = $data['id'];
	}

	foreach ($result as $row)
	{
		mysql_query("
			INSERT INTO `chests_user` SET `user_id`='$row',
											`time`='".time()."',
											`chest_id`='4'
			") or die (mysql_error());
	}
}






include_once __DIR__ . '../../core/foot.php';