<?php
if($hcari["n1"][0]<>"-"){
	if(trim($module["currency"])=="TRY"){
		if($hcari["t6"]=="" or $hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$cpb1=$cpb1+$hcari["pb1"];
			$cpb2=$cpb2+$hcari["pb2"];
			$cpb3=$cpb3+$hcari["pb3"];
			$cpb4=$cpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="EUR"){
			$cpb1=$cpb1+($hcari["pb1"]*$eur);
			$cpb2=$cpb2+($hcari["pb2"]*$eur);
			$cpb3=$cpb3+($hcari["pb3"]*$eur);
			$cpb4=$cpb4+($hcari["pb4"]*$eur);
		}elseif($hcari["t6"]=="USD"){
			$cpb1=$cpb1+($hcari["pb1"]*$usd);
			$cpb2=$cpb2+($hcari["pb2"]*$usd);
			$cpb3=$cpb3+($hcari["pb3"]*$usd);
			$cpb4=$cpb4+($hcari["pb4"]*$usd);
		}elseif($hcari["t6"]=="GBP"){
			$cpb1=$cpb1+($hcari["pb1"]*$gbp);
			$cpb2=$cpb2+($hcari["pb2"]*$gbp);
			$cpb3=$cpb3+($hcari["pb3"]*$gbp);
			$cpb4=$cpb4+($hcari["pb4"]*$gbp);
		}
	}elseif(trim($module["currency"])=="USD"){
		if($hcari["t6"]=="" or $hcari["t6"]=="USD"){
			$cpb1=$cpb1+$hcari["pb1"];
			$cpb2=$cpb2+$hcari["pb2"];
			$cpb3=$cpb3+$hcari["pb3"];
			$cpb4=$cpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="EUR"){
			$cpb1=$cpb1+($hcari["pb1"]*$eur/$usd);
			$cpb2=$cpb2+($hcari["pb2"]*$eur/$usd);
			$cpb3=$cpb3+($hcari["pb3"]*$eur/$usd);
			$cpb4=$cpb4+($hcari["pb4"]*$eur/$usd);
		}elseif($hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$cpb1=$cpb1+($hcari["pb1"]/$usd);
			$cpb2=$cpb2+($hcari["pb2"]/$usd);
			$cpb3=$cpb3+($hcari["pb3"]/$usd);
			$cpb4=$cpb4+($hcari["pb4"]/$usd);
		}elseif($hcari["t6"]=="GBP"){
			$cpb1=$cpb1+($hcari["pb1"]*$gbp/$usd);
			$cpb2=$cpb2+($hcari["pb2"]*$gbp/$usd);
			$cpb3=$cpb3+($hcari["pb3"]*$gbp/$usd);
			$cpb4=$cpb4+($hcari["pb4"]*$gbp/$usd);
		}
	}elseif(trim($module["currency"])=="EUR"){
		if($hcari["t6"]=="" or $hcari["t6"]=="EUR"){
			$cpb1=$cpb1+$hcari["pb1"];
			$cpb2=$cpb2+$hcari["pb2"];
			$cpb3=$cpb3+$hcari["pb3"];
			$cpb4=$cpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="USD"){
			$cpb1=$cpb1+($hcari["pb1"]*$usd/$eur);
			$cpb2=$cpb2+($hcari["pb2"]*$usd/$eur);
			$cpb3=$cpb3+($hcari["pb3"]*$usd/$eur);
			$cpb4=$cpb4+($hcari["pb4"]*$usd/$eur);
		}elseif($hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$cpb1=$cpb1+($hcari["pb1"]/$eur);
			$cpb2=$cpb2+($hcari["pb2"]/$eur);
			$cpb3=$cpb3+($hcari["pb3"]/$eur);
			$cpb4=$cpb4+($hcari["pb4"]/$eur);
		}elseif($hcari["t6"]=="GBP"){
			$cpb1=$cpb1+($hcari["pb1"]*$gbp/$eur);
			$cpb2=$cpb2+($hcari["pb2"]*$gbp/$eur);
			$cpb3=$cpb3+($hcari["pb3"]*$gbp/$eur);
			$cpb4=$cpb4+($hcari["pb4"]*$gbp/$eur);
		}
	}elseif(trim($module["currency"])=="GBP"){
		if($hcari["t6"]=="" or $hcari["t6"]=="GBP"){
			$cpb1=$cpb1+$hcari["pb1"];
			$cpb2=$cpb2+$hcari["pb2"];
			$cpb3=$cpb3+$hcari["pb3"];
			$cpb4=$cpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="USD"){
			$cpb1=$cpb1+($hcari["pb1"]*$usd/$gbp);
			$cpb2=$cpb2+($hcari["pb2"]*$usd/$gbp);
			$cpb3=$cpb3+($hcari["pb3"]*$usd/$gbp);
			$cpb4=$cpb4+($hcari["pb4"]*$usd/$gbp);
		}elseif($hcari["t6"]=="EUR"){
			$cpb1=$cpb1+($hcari["pb1"]*$eur/$gbp);
			$cpb2=$cpb2+($hcari["pb2"]*$eur/$gbp);
			$cpb3=$cpb3+($hcari["pb3"]*$eur/$gbp);
			$cpb4=$cpb4+($hcari["pb4"]*$eur/$gbp);
		}elseif($hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$cpb1=$cpb1+($hcari["pb1"]/$gbp);
			$cpb2=$cpb2+($hcari["pb2"]/$gbp);
			$cpb3=$cpb3+($hcari["pb3"]/$gbp);
			$cpb4=$cpb4+($hcari["pb4"]/$gbp);
		}
	}elseif($module["currency"]==""){
			$cpb1=$cpb1+$hcari["pb1"];
			$cpb2=$cpb2+$hcari["pb2"];
			$cpb3=$cpb3+$hcari["pb3"];
			$cpb4=$cpb4+$hcari["pb4"];
		if($hcari["t6"]=="" or $hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$try_pb1=$try_pb1+$hcari["pb1"];
			$try_pb2=$try_pb2+$hcari["pb2"];
			$try_pb3=$try_pb3+$hcari["pb3"];
			$try_pb4=$try_pb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="EUR"){
			$eur_pb1=$eur_pb1+($hcari["pb1"]);
			$eur_pb2=$eur_pb2+($hcari["pb2"]);
			$eur_pb3=$eur_pb3+($hcari["pb3"]);
			$eur_pb4=$eur_pb4+($hcari["pb4"]);
		}elseif($hcari["t6"]=="USD"){
			$usd_pb1=$usd_pb1+($hcari["pb1"]);
			$usd_pb2=$usd_pb2+($hcari["pb2"]);
			$usd_pb3=$usd_pb3+($hcari["pb3"]);
			$usd_pb4=$usd_pb4+($hcari["pb4"]);
		}elseif($hcari["t6"]=="GBP"){
			$gbp_pb1=$gbp_pb1+($hcari["pb1"]);
			$gbp_pb2=$gbp_pb2+($hcari["pb2"]);
			$gbp_pb3=$gbp_pb3+($hcari["pb3"]);
			$gbp_pb4=$gbp_pb4+($hcari["pb4"]);
		}
	}
}else{
	if(trim($module["currency"])=="TRY"){
		if($hcari["t6"]=="" or $hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$mcpb1=$mcpb1+$hcari["pb1"];
			$mcpb2=$mcpb2+$hcari["pb2"];
			$mcpb3=$mcpb3+$hcari["pb3"];
			$mcpb4=$mcpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="EUR"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$eur);
			$mcpb2=$mcpb2+($hcari["pb2"]*$eur);
			$mcpb3=$mcpb3+($hcari["pb3"]*$eur);
			$mcpb4=$mcpb4+($hcari["pb4"]*$eur);
		}elseif($hcari["t6"]=="USD"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$usd);
			$mcpb2=$mcpb2+($hcari["pb2"]*$usd);
			$mcpb3=$mcpb3+($hcari["pb3"]*$usd);
			$mcpb4=$mcpb4+($hcari["pb4"]*$usd);
		}elseif($hcari["t6"]=="GBP"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$gbp);
			$mcpb2=$mcpb2+($hcari["pb2"]*$gbp);
			$mcpb3=$mcpb3+($hcari["pb3"]*$gbp);
			$mcpb4=$mcpb4+($hcari["pb4"]*$gbp);
		}
	}elseif(trim($module["currency"])=="USD"){
		if($hcari["t6"]=="" or $hcari["t6"]=="USD"){
			$mcpb1=$mcpb1+$hcari["pb1"];
			$mcpb2=$mcpb2+$hcari["pb2"];
			$mcpb3=$mcpb3+$hcari["pb3"];
			$mcpb4=$mcpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="EUR"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$eur/$usd);
			$mcpb2=$mcpb2+($hcari["pb2"]*$eur/$usd);
			$mcpb3=$mcpb3+($hcari["pb3"]*$eur/$usd);
			$mcpb4=$mcpb4+($hcari["pb4"]*$eur/$usd);
		}elseif($hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$mcpb1=$mcpb1+($hcari["pb1"]/$usd);
			$mcpb2=$mcpb2+($hcari["pb2"]/$usd);
			$mcpb3=$mcpb3+($hcari["pb3"]/$usd);
			$mcpb4=$mcpb4+($hcari["pb4"]/$usd);
		}elseif($hcari["t6"]=="GBP"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$gbp/$usd);
			$mcpb2=$mcpb2+($hcari["pb2"]*$gbp/$usd);
			$mcpb3=$mcpb3+($hcari["pb3"]*$gbp/$usd);
			$mcpb4=$mcpb4+($hcari["pb4"]*$gbp/$usd);
		}
	}elseif(trim($module["currency"])=="EUR"){
		if($hcari["t6"]=="" or $hcari["t6"]=="EUR"){
			$mcpb1=$mcpb1+$hcari["pb1"];
			$mcpb2=$mcpb2+$hcari["pb2"];
			$mcpb3=$mcpb3+$hcari["pb3"];
			$mcpb4=$mcpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="USD"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$usd/$eur);
			$mcpb2=$mcpb2+($hcari["pb2"]*$usd/$eur);
			$mcpb3=$mcpb3+($hcari["pb3"]*$usd/$eur);
			$mcpb4=$mcpb4+($hcari["pb4"]*$usd/$eur);
		}elseif($hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$mcpb1=$mcpb1+($hcari["pb1"]/$eur);
			$mcpb2=$mcpb2+($hcari["pb2"]/$eur);
			$mcpb3=$mcpb3+($hcari["pb3"]/$eur);
			$mcpb4=$mcpb4+($hcari["pb4"]/$eur);
		}elseif($hcari["t6"]=="GBP"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$gbp/$eur);
			$mcpb2=$mcpb2+($hcari["pb2"]*$gbp/$eur);
			$mcpb3=$mcpb3+($hcari["pb3"]*$gbp/$eur);
			$mcpb4=$mcpb4+($hcari["pb4"]*$gbp/$eur);
		}
	}elseif(trim($module["currency"])=="GBP"){
		if($hcari["t6"]=="" or $hcari["t6"]=="GBP"){
			$cpb1=$mcpb1+$hcari["pb1"];
			$cpb2=$mcpb2+$hcari["pb2"];
			$cpb3=$mcpb3+$hcari["pb3"];
			$cpb4=$mcpb4+$hcari["pb4"];
		}elseif($hcari["t6"]=="USD"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$usd/$gbp);
			$mcpb2=$mcpb2+($hcari["pb2"]*$usd/$gbp);
			$mcpb3=$mcpb3+($hcari["pb3"]*$usd/$gbp);
			$mcpb4=$mcpb4+($hcari["pb4"]*$usd/$gbp);
		}elseif($hcari["t6"]=="EUR"){
			$mcpb1=$mcpb1+($hcari["pb1"]*$eur/$gbp);
			$mcpb2=$mcpb2+($hcari["pb2"]*$eur/$gbp);
			$mcpb3=$mcpb3+($hcari["pb3"]*$eur/$gbp);
			$mcpb4=$mcpb4+($hcari["pb4"]*$eur/$gbp);
		}elseif($hcari["t6"]=="TL" or $hcari["t6"]=="TRY"){
			$mcpb1=$mcpb1+($hcari["pb1"]/$gbp);
			$mcpb2=$mcpb2+($hcari["pb2"]/$gbp);
			$mcpb3=$mcpb3+($hcari["pb3"]/$gbp);
			$mcpb4=$mcpb4+($hcari["pb4"]/$gbp);
		}
	}elseif($module["currency"]==""){
			$mcpb1=$mcpb1+$hcari["pb1"];
			$mcpb2=$mcpb2+$hcari["pb2"];
			$mcpb3=$mcpb3+$hcari["pb3"];
			$mcpb4=$mcpb4+$hcari["pb4"];
	}
}
?>