Testrapport #5 fix
This commit is contained in:
parent
16035fee7a
commit
a62fdd9491
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,15 @@
|
||||
<?php include '__header.phtml'; ?>
|
||||
|
||||
<?php
|
||||
if (!$statistieken) {
|
||||
?>
|
||||
|
||||
<div class="alert alert-danger" role="alert"><b>Fout!</b> Dit is niet een aan jouw account gekoppelde rekening.</div>
|
||||
<?php
|
||||
|
||||
} else {
|
||||
?>
|
||||
|
||||
<a class="btn btn-default pull-left" href="rekeningen/<?= $rekeningnr?>" role="button">Terug</a>
|
||||
<canvas id="myChart" height="100"></canvas>
|
||||
<script>
|
||||
@ -32,5 +43,8 @@
|
||||
}]
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
</script>
|
||||
<?php include '__footer.phtml'; ?>
|
||||
|
Reference in New Issue
Block a user