diff --git a/Documentatie_Eindopdracht_Informatica.docx b/Documentatie_Eindopdracht_Informatica.docx new file mode 100644 index 0000000..f3c6035 Binary files /dev/null and b/Documentatie_Eindopdracht_Informatica.docx differ diff --git a/src/Application/Overboeking.php b/src/Application/Overboeking.php new file mode 100644 index 0000000..275db21 --- /dev/null +++ b/src/Application/Overboeking.php @@ -0,0 +1,39 @@ +get('/overboeking', function ($request, $response, $args) { + $klant = Klant::getCurrentUser(); + $rekeningen = Rekeningen::getCurrentUserRekeningen(); + + + + return $this->renderer->render($response, 'overboeking.phtml', [ + 'klant' => $klant, + 'rekeningen' => $rekeningen + ]); + }); + } +} diff --git a/src/Application/Transacties.php b/src/Application/Transacties.php new file mode 100644 index 0000000..cbc5f7a --- /dev/null +++ b/src/Application/Transacties.php @@ -0,0 +1,64 @@ +get('/rekeningen/{rekeningnummer}', function ($request, $response, $args) { + $klant = Klant::getCurrentUser(); + $rekeningen = Rekeningen::getCurrentUserRekeningen(); + + $ibanhelper = new IBAN; + $rekening = false; + $rekeningnr = $args['rekeningnummer']; + + foreach($rekeningen as $rek){ + if($rek['nr'] === $rekeningnr){ + $rekening = $rek; + break; + } + } + + $container = Application::getContainer(); + $db = $container->db; + $transacties = $db->transacties->where('van', '12345678')->or('naar', $rekeningnr); + + $returnArray = array(); + + foreach ($transacties as $transactie) { + $returnArray[] = array( + "van" => $ibanhelper->getIBAN($transactie['van']), + "naar" => $ibanhelper->getIBAN($transactie['naar']), + "bedrag" => $transactie['bedrag'], + "type" => $transactie['type'] + ); + } + + return $this->renderer->render($response, 'transacties.phtml', [ + 'klant' => $klant, + 'rekening' => $rekening, + 'transacties' => $returnArray + ]); + }); + } +} diff --git a/src/bootstrap.php b/src/bootstrap.php index 0eecfca..f2f6cc3 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -116,6 +116,8 @@ Inforbank\Application::set($app); new Inforbank\Application\Login($app); new Inforbank\Application\Daniel($app); new Inforbank\Application\Main($app); +new Inforbank\Application\Transacties($app); +new Inforbank\Application\Overboeking($app); // Added API handler new Inforbank\Application\API\Handler($app); diff --git a/templates/index.phtml b/templates/index.phtml index eae0089..97b9b54 100644 --- a/templates/index.phtml +++ b/templates/index.phtml @@ -12,7 +12,7 @@ - + + +
+
+
+ + + diff --git a/templates/transacties.phtml b/templates/transacties.phtml new file mode 100644 index 0000000..d40d203 --- /dev/null +++ b/templates/transacties.phtml @@ -0,0 +1,23 @@ + + + +Fout: niet jouw eigen rekening. + + +Saldo:
+"; + echo json_encode($transactie); + echo "
"; +} +?> + + +