Trade Commissions , можете ли да ми покажете къде бъркам не се получава
<?php
$city=strtolower(readline());
$sales=floatval(readline());
$commission=-1;
if($city=='sofia') {
if($sales>=0 && $sales<=500) {
$commission=$sales*0.05;
}else if ($sales>500 && $sales<=1000) {
$commission=$sales*0.07;
}else if ($sales>1000 && $sales<=10000) {
$commission=$sales*0.08;
}else if ($sales>10000 ) {
$commission=$sales*0.12;
}
else {
echo 'error';
}
printf ("%0.2f",$commission);
}else if($city=='varna') {
if($sales>=0 && $sales<=500) {
$commission=$sales*0.045;
}else if ($sales>500 && $sales<=1000) {
$commission=$sales*0.075;
}else if ($sales>1000 && $sales<=10000) {
$commission=$sales*0.1;
}else if ($sales>10000 ) {
$commission=$sales*0.13;
}
else {
echo 'error';
}
printf ("%0.2f",$commission);
}else if($city=='plovdiv') {
if($sales>=0 && $sales<=500) {
$commission=$sales*0.055;
}else if ($sales>500 && $sales<=1000) {
$commission=$sales*0.08;
}else if ($sales>1000 && $sales<=10000) {
$commission=$sales*0.12;
}else if ($sales>10000 ) {
$commission=$sales*0.145;
}
else {
echo 'error';
}
printf ("%0.2f",$commission);
}