$origin = 0; } $repository = new DatacenterDao(Connection::connect()); CacheCountry::setCacheBehavior(SessionAdmin::getCacheBehavior()); $cache = CacheCountry::getCountries(); $service = new DatacenterService($repository, $cache); //$countryMap); $statistic = new Statistic(); $grouper = new DataGrouper(); $controller = new DatacenterController($service, $statistic, $jsonResponse, $grouper, $factory); $reader = new Spreadsheet_Excel_Reader($_FILES['Planilha']['tmp_name']); try { $inputFile = new ExcelInputFile($reader); if (insertingValuesForInternationalTrade($subgroup)) { //$typeCountry = 'origin'; $response = $controller->saveValues($inputFile, $subgroup, $font, $origin, $destiny, $coffeType, $variety, $typeCountry, true); } else { $response = $controller->saveValues($inputFile, $subgroup, $font, $origin, $destiny, $coffeType, $variety, $typeCountry); } print_r($response); } catch (WrongFormatException $exception) { print_r($jsonResponse->response(false, $exception->getMessage())->withoutHeader()->serialize()); } catch (Exception $exception) { print_r($jsonResponse->response(false, $exception->getMessage())->withoutHeader()->serialize()); } } else { print_r($jsonResponse->response(false, "Todos os campos devem ser preenchidos e/ou marcados.")->withoutHeader()->serialize()); } } else { print_r($jsonResponse->response(false, "Parâmetros não configurados corretamente.")->withoutHeader()->serialize()); }