<?
/**
 * @Project GoldMU.Net
 * @copyright 03/03/2022
 * @Email: goldmu.net@gmail.com
 * @Zalo: 0923 117 898
*/
 
$dayofweek = date('w', time());

if($use_gioihanrs_type[$thehe_choise] == 1) { //Type1: Default
	if($char_in_top == 1) $gioihanrs = $gioihanrs_top1[$thehe_choise];
	elseif($char_in_top == 2) $gioihanrs = $gioihanrs_top2[$thehe_choise];
	elseif($char_in_top == 3) $gioihanrs = $gioihanrs_top3[$thehe_choise];
	elseif($char_in_top == 4) $gioihanrs = $gioihanrs_top4[$thehe_choise];
	elseif($char_in_top >4 && $char_in_top<=10) $gioihanrs = $gioihanrs_top10[$thehe_choise];
	elseif($char_in_top >10 && $char_in_top<=20) $gioihanrs = $gioihanrs_top20[$thehe_choise];
	elseif($char_in_top >20 && $char_in_top<=30) $gioihanrs = $gioihanrs_top30[$thehe_choise];
	elseif($char_in_top >30 && $char_in_top<=40) $gioihanrs = $gioihanrs_top40[$thehe_choise];
	elseif($char_in_top >40 && $char_in_top<=50) $gioihanrs = $gioihanrs_top50[$thehe_choise];
	elseif($char_in_top >50 && $char_in_top<=60) $gioihanrs = $gioihanrs_top60[$thehe_choise];
	elseif($char_in_top >60 && $char_in_top<=70) $gioihanrs = $gioihanrs_top70[$thehe_choise];
	elseif($char_in_top >70 && $char_in_top<=80) $gioihanrs = $gioihanrs_top80[$thehe_choise];
	elseif($char_in_top >80 && $char_in_top<=90) $gioihanrs = $gioihanrs_top90[$thehe_choise];
	elseif($char_in_top >90 && $char_in_top<=100) $gioihanrs = $gioihanrs_top100[$thehe_choise];
	else $gioihanrs = $gioihanrs_other[$thehe_choise];
	
	if($dayofweek == 0) $gioihanrs = $gioihanrs + floor($gioihanrs * $overrs_sun_extra[$thehe_choise]/100);
	else if($dayofweek == 6) $gioihanrs = $gioihanrs + floor($gioihanrs * $overrs_sat_extra[$thehe_choise]/100);
}
else { //Custom, reset limit by Top1
	
	if($use_gioihanrs_type[$thehe_choise] == 2) { //Type2: all limit by Top1
		$gioihanrs = $_SESSION['nv_ghrs'];
		
		if($char_in_top == 1) $duocreset = $gioihanrs_top1_type2[$thehe_choise];
		elseif($char_in_top == 2) { $duocreset = $gioihanrs_top2_type2[$thehe_choise]; }
		elseif($char_in_top == 3) { $duocreset = $gioihanrs_top3_type2[$thehe_choise]; }
		elseif($char_in_top == 4) { $duocreset = $gioihanrs_top4_type2[$thehe_choise]; }
		elseif($char_in_top >4 && $char_in_top<=10) { $duocreset = $gioihanrs_top10_type2[$thehe_choise]; }
		elseif($char_in_top >10 && $char_in_top<=20) { $duocreset = $gioihanrs_top20_type2[$thehe_choise]; }
		elseif($char_in_top >20 && $char_in_top<=30) { $duocreset = $gioihanrs_top30_type2[$thehe_choise]; }
		elseif($char_in_top >30 && $char_in_top<=40) { $duocreset = $gioihanrs_top40_type2[$thehe_choise]; }
		elseif($char_in_top >40 && $char_in_top<=50) { $duocreset = $gioihanrs_top50_type2[$thehe_choise]; }
		elseif($char_in_top >50 && $char_in_top<=60) { $duocreset = $gioihanrs_top60_type2[$thehe_choise]; }
		elseif($char_in_top >60 && $char_in_top<=70) { $duocreset = $gioihanrs_top70_type2[$thehe_choise]; }
		elseif($char_in_top >70 && $char_in_top<=80) { $duocreset = $gioihanrs_top80_type2[$thehe_choise]; }
		elseif($char_in_top >80 && $char_in_top<=90) { $duocreset = $gioihanrs_top90_type2[$thehe_choise]; }
		elseif($char_in_top >90 && $char_in_top<=100) { $duocreset = $gioihanrs_top100_type2[$thehe_choise]; }
		else { $duocreset = $gioihanrs_other_type2[$thehe_choise]; }

	}
	elseif($use_gioihanrs_type[$thehe_choise] == 3) { //Type3: Top>100 limit by Top1
		$gioihanrs = $_SESSION['nv_ghrs'];

		if($char_in_top != 1) { $duocreset = $gioihanrs_other_type3[$thehe_choise]; }
	}
}
?>