<?
/**
 * @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_upresetday.php');
include('config/config_gioihanrs.php');

$thehe_choise = $_SESSION['acc_thehe'];
$char_in_top = $_SESSION['nv_top50'];

if($_SESSION['nv_top50'] ==0 ) $show_top = " > 100";
else $show_top = $char_in_top;

if($use_upresetday[$thehe_choise] == 1) {

if($char_in_top == 1) { $money_need = $uprs_top1_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top1_pointphucloi[$thehe_choise]; }
elseif($char_in_top == 2) { $money_need = $uprs_top2_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top2_pointphucloi[$thehe_choise]; }
elseif($char_in_top == 3) { $money_need = $uprs_top3_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top3_pointphucloi[$thehe_choise]; }
elseif($char_in_top == 4) { $money_need = $uprs_top4_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top4_pointphucloi[$thehe_choise]; }
elseif($char_in_top >4 && $char_in_top<=10) { $money_need = $uprs_top10_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top10_pointphucloi[$thehe_choise]; }
elseif($char_in_top >10 && $char_in_top<=20) { $money_need = $uprs_top20_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top20_pointphucloi[$thehe_choise]; }
elseif($char_in_top >20 && $char_in_top<=30) { $money_need = $uprs_top30_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top30_pointphucloi[$thehe_choise]; }
elseif($char_in_top >30 && $char_in_top<=40) { $money_need = $uprs_top40_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top40_pointphucloi[$thehe_choise]; }
elseif($char_in_top >40 && $char_in_top<=50) { $money_need = $uprs_top50_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top50_pointphucloi[$thehe_choise]; }
elseif($char_in_top >50 && $char_in_top<=60) { $money_need = $uprs_top60_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top60_pointphucloi[$thehe_choise]; }
elseif($char_in_top >60 && $char_in_top<=70) { $money_need = $uprs_top70_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top70_pointphucloi[$thehe_choise]; }
elseif($char_in_top >70 && $char_in_top<=80) { $money_need = $uprs_top80_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top80_pointphucloi[$thehe_choise]; }
elseif($char_in_top >80 && $char_in_top<=90) { $money_need = $uprs_top90_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top90_pointphucloi[$thehe_choise]; }
elseif($char_in_top >90 && $char_in_top<=100) { $money_need = $uprs_top100_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_top100_pointphucloi[$thehe_choise]; }
else { $money_need = $uprs_other_gcoin[$thehe_choise]; $pointphucloi_need = $uprs_other_pointphucloi[$thehe_choise]; }

$accept = 1;

$check_reset = $_SESSION['nv_reset'];
$check_relife = $_SESSION['nv_relife'];
$resetday = $_SESSION['nv_resetday'];

$Top1_TotalRS = $_SESSION['top1_rs'];
$SUM_Top1_TotalRS = $_SESSION['sum_top1_rs'];

$char_sumrs = ResetTotal($check_reset, $check_relife);

if($use_gioihanrs[$thehe_choise] == 1) {
	require_once('modules/char_manager/ghrs.php'); 
    
	$resetleft = $gioihanrs-$_SESSION[nv_resetday];
	if( $_SESSION['nv_resetday'] >= $gioihanrs ) {
		if($_SESSION['nv_resetday'] >= ($gioihanrs+$overrs_rs[$thehe_choise])) $accept = 0;
		$resetleft_notice = "<font color='red'><b> $resetleft </b></font>";
		$notice_resetday = "$font_thieu_begin $_SESSION[nv_resetday] / $gioihanrs $font_thieu_end";
	} else {
		$resetleft_notice = "<font color='green'><b> $resetleft </b></font>";
		$notice_resetday = "$font_du_begin $_SESSION[nv_resetday] / $gioihanrs $font_du_end";
	}
}
else {
	echo "<font color='red'><b> Chức năng không được sử dụng. </b></font>";
	exit();
}
if ( $_SESSION['nv_online'] == 1 || $_SESSION['nv_doinv'] == 0 || $chenhlech_level < 0 || $resetleft == 0 || ( $chenhlech_gcoin < 0 && $chenhlech_vpoint < 0) ) { $accept = 0; }	

$page_template = "templates/char_manager/upresetday.tpl";
}else{
echo "<center><font color=red>Thế hệ của bạn không được dùng Up Resets.</font></center>"; exit();
}
?>