<?
/**
 * @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");

if(isset($Use_NONRS) && $Use_NONRS == 1){
	$name_thangcap = "Level";
	$type_thangcap = "level";
}else{
	$name_thangcap = "Reset";
	$type_thangcap = "reset_all";
}
		
if(isset($event_thangcap_on) && $event_thangcap_on == 1) {
    // Read Event Config
    $thangcap_arr = _json_fileload('config/event_thangcap.txt');
    // Read Event Config End
    
    $getcontent_url = $server_url . "/event_thangcap.php";
    $getcontent_data = array(
        'login'    =>  $_SESSION['mu_username'],
        'name'    =>  $_SESSION['mu_nvchon'],
        
        'string_login'    =>  $_SESSION['checklogin'],
        'passtransfer'    =>  $passtransfer
    );
    
    $reponse = _getContent($getcontent_url, $getcontent_data, $getcontent_method, $getcontent_curl);

	if ( empty($reponse) ) $error_module = "Server bảo trì.";
	elseif($reponse == "login_other") {
		$error_module = "Tài khoản đã được đăng nhập trên trình duyệt khác hoặc máy tính khác.";
		session_destroy();
	}
	else {
		if ( read_TagName($reponse, 'info', 1) == 'OK' ) {
            $thangcap_check = read_TagName($reponse, 'thangcap_check', 1);
            $gift_danhan = read_TagName($reponse, 'gift_danhan', 1);
            $gift_danhan_arr = json_decode($gift_danhan, true);
		} else echo $reponse;
	}
    
    $page_template = "templates/event/event_thangcap.tpl";
} else {
    echo "<div class='form-error'>Event chưa bật.</div>";
}

?>