diff --git a/Documentatie_Eindopdracht_Informatica.docx b/Documentatie_Eindopdracht_Informatica.docx index 121b618..c687b5e 100644 Binary files a/Documentatie_Eindopdracht_Informatica.docx and b/Documentatie_Eindopdracht_Informatica.docx differ diff --git a/src/Application/Statistieken.php b/src/Application/Statistieken.php index e307a45..ef9c0bb 100644 --- a/src/Application/Statistieken.php +++ b/src/Application/Statistieken.php @@ -19,19 +19,28 @@ use Inforbank\Application\Helper\Header; use Inforbank\Application\Helper\Statistieken as StatistiekenHelper; use Slim\App; -class Statistieken { +class Statistieken +{ public function __construct(App $app) { $app->get('/statistieken/{rekeningnummer}', function ($request, $response, $args) { - $verloop = StatistiekenHelper::getSaldoverloop(30, $args['rekeningnummer']); - return $this->renderer->render($response, "statistieken.phtml", [ - "header" => Header::getHeaderData(), - "rekeningnr" => $args['rekeningnummer'], - "statistieken" => [ - "x-as" => $verloop['x-as'], - "y-as" => $verloop['y-as'] - ] - ]); + try { + $verloop = StatistiekenHelper::getSaldoverloop(30, $args['rekeningnummer']); + return $this->renderer->render($response, "statistieken.phtml", [ + "header" => Header::getHeaderData(), + "rekeningnr" => $args['rekeningnummer'], + "statistieken" => [ + "x-as" => $verloop['x-as'], + "y-as" => $verloop['y-as'] + ] + ]); + } catch (\Exception $e) { + return $this->renderer->render($response, "statistieken.phtml", [ + "header" => Header::getHeaderData(), + "rekeningnr" => $args['rekeningnummer'], + "statistieken" => false + ]); + } })->add(new Middleware()); } } diff --git a/templates/statistieken.phtml b/templates/statistieken.phtml index dc412fd..4dd6e0d 100644 --- a/templates/statistieken.phtml +++ b/templates/statistieken.phtml @@ -1,6 +1,18 @@ Terug + + + + + +Terug +