<?
/** 
 * @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_uplvitem.php');
	$jbkhoa = $_GET['ijbkhoa'];         $jbkhoa = abs(intval($jbkhoa));
	$gcoin = $_GET['igcoin'];         $gcoin = abs(intval($gcoin));
    //$chao = $_GET['ichao'];         $chao = abs(intval($chao));
   // $cre = $_GET['icre'];           $cre = abs(intval($cre));
   // $blue = $_GET['iblue'];         $blue = abs(intval($blue));
    $lvitem = $_GET['ilvitem'];     $lvitem = abs(intval($lvitem));
    
    switch ($lvitem){ 
	case 0:
		$gcoin_percent = $lv1_gcoin;
		$jbkhoa_percent = $lv1_jbkhoa;
        $chao_percent = $lv1_chao;
        $cre_percent = $lv1_cre;
        $blue_percent = $lv1_blue;
        $max_percent = $lv1_max;
	break;

	case 1:
		$gcoin_percent = $lv2_gcoin;
		$jbkhoa_percent = $lv2_jbkhoa;
        $chao_percent = $lv2_chao;
        $cre_percent = $lv2_cre;
        $blue_percent = $lv2_blue;
        $max_percent = $lv2_max;
	break;

	case 2:
		$gcoin_percent = $lv3_gcoin;
		$jbkhoa_percent = $lv3_jbkhoa;
        $chao_percent = $lv3_chao;
        $cre_percent = $lv3_cre;
        $blue_percent = $lv3_blue;
        $max_percent = $lv3_max;
	break;

    case 3:
		$gcoin_percent = $lv4_gcoin;
		$jbkhoa_percent = $lv4_jbkhoa;
        $chao_percent = $lv4_chao;
        $cre_percent = $lv4_cre;
        $blue_percent = $lv4_blue;
        $max_percent = $lv4_max;
	break;

    case 4:
		$gcoin_percent = $lv5_gcoin;
		$jbkhoa_percent = $lv5_jbkhoa;
        $chao_percent = $lv5_chao;
        $cre_percent = $lv5_cre;
        $blue_percent = $lv5_blue;
        $max_percent = $lv5_max;
	break;

    case 5:
		$gcoin_percent = $lv6_gcoin;
		$jbkhoa_percent = $lv6_jbkhoa;
        $chao_percent = $lv6_chao;
        $cre_percent = $lv6_cre;
        $blue_percent = $lv6_blue;
        $max_percent = $lv6_max;
	break;

    case 6:
		$gcoin_percent = $lv7_gcoin;
		$jbkhoa_percent = $lv7_jbkhoa;
        $chao_percent = $lv7_chao;
        $cre_percent = $lv7_cre;
        $blue_percent = $lv7_blue;
        $max_percent = $lv7_max;
	break;

    case 7:
		$gcoin_percent = $lv8_gcoin;
		$jbkhoa_percent = $lv8_jbkhoa;
        $chao_percent = $lv8_chao;
        $cre_percent = $lv8_cre;
        $blue_percent = $lv8_blue;
        $max_percent = $lv8_max;
	break;

    case 8:
		$gcoin_percent = $lv9_gcoin;
		$jbkhoa_percent = $lv9_jbkhoa;
        $chao_percent = $lv9_chao;
        $cre_percent = $lv9_cre;
        $blue_percent = $lv9_blue;
        $max_percent = $lv9_max;
	break;

    case 9:
		$gcoin_percent = $lv10_gcoin;
		$jbkhoa_percent = $lv10_jbkhoa;
        $chao_percent = $lv10_chao;
        $cre_percent = $lv10_cre;
        $blue_percent = $lv10_blue;
        $max_percent = $lv10_max;
	break;

    case 10:
		$gcoin_percent = $lv11_gcoin;
		$jbkhoa_percent = $lv11_jbkhoa;
        $chao_percent = $lv11_chao;
        $cre_percent = $lv11_cre;
        $blue_percent = $lv11_blue;
        $max_percent = $lv11_max;
	break;

    case 11:
		$gcoin_percent = $lv12_gcoin;
		$jbkhoa_percent = $lv12_jbkhoa;
        $chao_percent = $lv12_chao;
        $cre_percent = $lv12_cre;
        $blue_percent = $lv12_blue;
        $max_percent = $lv12_max;
	break;

    case 12:
		$gcoin_percent = $lv13_gcoin;
		$jbkhoa_percent = $lv13_jbkhoa;
        $chao_percent = $lv13_chao;
        $cre_percent = $lv13_cre;
        $blue_percent = $lv13_blue;
        $max_percent = $lv13_max;
	break;

    case 13:
		$gcoin_percent = $lv14_gcoin;
		$jbkhoa_percent = $lv14_jbkhoa;
        $chao_percent = $lv14_chao;
        $cre_percent = $lv14_cre;
        $blue_percent = $lv14_blue;
        $max_percent = $lv14_max;
	break;

    case 14:
		$gcoin_percent = $lv15_gcoin;
		$jbkhoa_percent = $lv15_jbkhoa;
        $chao_percent = $lv15_chao;
        $cre_percent = $lv15_cre;
        $blue_percent = $lv15_blue;
        $max_percent = $lv15_max;
	break;

	default :
		$gcoin_percent = 0;
		$jbkhoa_percent = 0;
        $chao_percent = 0;
        $cre_percent = 0;
        $blue_percent = 0;
        $max_percent = 0;
}
    //$percent = $chao * $chao_percent + $cre * $cre_percent + $blue * $blue_percent;
	$percent = $jbkhoa * $jbkhoa_percent + $gcoin * $gcoin_percent;
    if($percent > $max_percent) $percent = $max_percent;
    
    echo "<font color=blue><b>$percent %</b></font> / <font color=red><b>$max_percent %</b></font>";

?>