<?php

require 'SALARYService.class.php';
$salary = $_GET['salary'];
$calcINSS = 0.0;
/*$calcIRPF = 0.0;
$calcSalLiq = 0.0;*/
if (is_numeric($salary)) {
    $calcINSS = SALARYService::calculateinss($salary);
    /* $calcIRPF = SALARYService::calculate($salary - $calcINSS);*/
}
echo $calcINSS;
/*echo $calcIRPF;
echo $calcSalLiq;*/
<?php

require '../services/SALARYService.class.php';
$salary = $_GET['salary'];
if (is_numeric($salary)) {
    $inss = SALARYService::getINSS($salary);
    $baseSalary = SALARYService::getBaseSalary($salary);
    $ir = SALARYService::getIR($baseSalary);
    $liquidSalary = SALARYService::getLiquidSalary($salary);
}
$calculation = array('INSS' => $inss, 'IRPF' => $ir, 'liquidSalary' => $liquidSalary);
echo json_encode($calculation);