<?php
include("include/db.conn.php");
require_once("include/conf.class.php");
$get=$cartCore->fetch_cart_shipping_by_country_code_global_id($_REQUEST['cuid'],$_REQUEST['global_id']);
$curreny_code=$_REQUEST['currencyid'];
$total=$_REQUEST['total'];

if(!empty($get['TAX_COUNTRY']))
{
	if($get['PRECENTAGE']==true)
	{
		$tax=($get['AMOUNT']/100)*$total;
		$final_total=$tax+$total;
	}
	else
	{
		$tax=$get['AMOUNT'];
		$final_total=$get['AMOUNT'] + $total;
	}
}
else
{
	$get=$cartCore->fetch_cart_shipping_by_country_code_global_id('ANY',$_REQUEST['global_id']);
	
	if($get['PRECENTAGE']==true)
	{
		$tax=($get['AMOUNT']/100)*$total;
		$final_total=$tax+$total;
	}
	else
	{
		$tax=$get['AMOUNT'];
		$final_total=$get['AMOUNT'] + $total;
	}
}
echo json_encode(array("num1"=>$tax,"num2"=>$curreny_code.' '.$final_total));
?>

