<?
/**
 * @Project GoldMU.Net
 * @copyright 03/03/2022
 * @Email: goldmu.net@gmail.com
 * @Zalo: 0923 117 898
*/
 
	if (!defined('GoldWebMU')) die("Ban khong co quyen truy cap he thong");
include('config/config_giftcode_rs.php');

if($giftcode_rs_use == 'none'){
	echo "Chức năng GiftCode Reset tuần không sử dụng"; exit();
}

$file_giftcode = 'config/giftcode_random.txt';

//Đọc File GiftCode
$giftcode_arr = array();
if(is_file($file_giftcode)) {
	$fopen_host = fopen($file_giftcode, "r");
	$giftcode_read = fgets($fopen_host);
	
	$giftcode_arr = json_decode($giftcode_read, true);
	fclose($fopen_host);
	if(!is_array($giftcode_arr)) $giftcode_arr = array();
}

$gift_name = $giftcode_arr[$giftcode_rs_use]['name'];
$item_read = $giftcode_arr[$giftcode_rs_use]['gift'];

$page_template = "templates/event/giftcode_rs.tpl";
?>