$types = $trace->getListOfTypes(); $res = json_encode($types); echo $res; } } if (isset($_POST['indicator'])) { if ($_POST['indicator'] == 'balance') { //$trace = new Trace($_POST['trace']); //$user = $trace->getBaseName(); //$manager = new Indicator_Manager($user); $Ind = new Indicator($_POST['trace']); $tA = str_replace(' ', '', $_POST['typeA']); $tB = str_replace(' ', '', $_POST['typeB']); $TypeObsel = array($tA, $tB); if (isset($_POST['after']) && isset($_POST['before'])) { $res = json_encode($Ind->balance($_POST['after'], $_POST['before'], $TypeObsel)); } else { $res = json_encode($Ind->balance(null, null, $TypeObsel)); } echo $res; } } if (isset($_POST['indicator'])) { if ($_POST['indicator'] == 'classification') { if (isset($_POST['trace'])) { $Ind = new Indicator($_POST['trace']); } if (isset($_POST['after']) && isset($_POST['before'])) { $res = json_encode($Ind->classification($_POST['after'], $_POST['before'])); } else { $res = json_encode($Ind->classification(null, null));