1
0

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/Application/Overboeking.php
#	src/Application/Transacties.php
This commit is contained in:
JelmerHinssen 2017-03-31 22:13:38 +02:00
commit 6cd6cb29e2
10 changed files with 247 additions and 112 deletions

117
assets/css/login.css Normal file
View File

@ -0,0 +1,117 @@
.appinfodiv{
background-color: #DDDDDD;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.formdiv{
background-color: #AAAAAA;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
@import url(http://fonts.googleapis.com/css?family=Roboto);
/****** LOGIN MODAL ******/
.loginmodal-container {
padding: 30px;
max-width: 350px;
width: 100% !important;
background-color: #F7F7F7;
margin: 0 auto;
border-radius: 2px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
overflow: hidden;
font-family: roboto;
}
.loginmodal-container h1 {
text-align: center;
font-size: 1.8em;
font-family: roboto;
}
.loginmodal-container input[type=submit] {
width: 100%;
display: block;
margin-bottom: 10px;
position: relative;
}
.loginmodal-container input[type=text], input[type=password] {
height: 44px;
font-size: 16px;
width: 100%;
margin-bottom: 10px;
-webkit-appearance: none;
background: #fff;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
padding: 0 8px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.loginmodal-container input[type=text]:hover, input[type=password]:hover {
border: 1px solid #b9b9b9;
border-top: 1px solid #a0a0a0;
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.loginmodal {
text-align: center;
font-size: 14px;
font-family: 'Arial', sans-serif;
font-weight: 700;
height: 36px;
padding: 0 8px;
}
.loginmodal-submit {
border: 0px;
color: #fff;
text-shadow: 0 1px rgba(0,0,0,0.1);
background-color: #4d90fe;
padding: 17px 0px;
font-family: roboto;
font-size: 14px;
}
.loginmodal-submit:hover {
border: 0px;
text-shadow: 0 1px rgba(0,0,0,0.3);
background-color: #357ae8;
}
.loginmodal-container a {
text-decoration: none;
color: #666;
font-weight: 400;
text-align: center;
display: inline-block;
opacity: 0.6;
transition: opacity ease 0.5s;
}
body{
color: #ff6000;
}
html, body{
height: 100%;
}
.logo{
display: block;
}
.full{
width: 100%;
height: 100%;
}

View File

@ -45,10 +45,22 @@ ul.nv {
/** Index **/
.clickable {
cursor: pointer;
color: #333;
}
.clickable:hover {
background: #0094ff;
text-decoration: none;
color: #333;
}
.clickable:hover > div {
background: #eaeaea;
}
.big {
font-size: 24px;
color: #0094ff;
font-weight: 600;
}
/** Footer **/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -16,30 +16,41 @@ namespace Inforbank\Application;
use \Slim\App;
use Inforbank\Application\Helper\Redirect;
use Inforbank\Proxy;
class Login
{
public function __construct(App $app)
{
$app->get('/login', function ($request, $response, $args) {
$query = $request->getQueryParams();
$error = isset($query['error']);
// Render index view
return $this->renderer->render($response, 'login.phtml', $args);
return $this->renderer->render($response, 'login.phtml', array(
'base' => Proxy::$route->getBaseUrl() . "/",
'error' => $error
));
});
$app->post('/login', function ($request, $response, $args) {
// Render index view
$post = $request->getParsedBody();
$query = $request->getQueryParams();
$redirect = $query['redirect'];
try {
$resp = $this->auth->login($post['rekeningnr'], $post['pascode']);
if ($resp) {
return Redirect::create($request, $response, '/');
if ($resp && $redirect !== "") {
return Redirect::create($request, $response, $redirect);
} elseif ($resp) {
return Redirect::create($request, $response, '/rekeningen');
} else {
return Redirect::create($request, $response, '/login?error');
return Redirect::create($request, $response, '/login?error&redirect='.$redirect);
}
} catch (\Exception $e) {
return Redirect::create($request, $response, '/login?error');
return Redirect::create($request, $response, '/login?error&redirect='.$redirect);
}
});

View File

@ -47,8 +47,17 @@ class Overboeking
Overboekingen::createOverboeking($ibanhelper->getIBAN($van), $naar, $bedrag, $omschrijving, "GT");
}catch(Exception $e){
return Redirect::create($request, $response, "/overboeking?$e");
//NL84 INFO 0023 4567 89
}
$db = Application::getContainer()->db;
$db->transacties->insert([
"van" => $vanRekening['nr'],
"naar" => $naarRekeningnr,
"bedrag" => $bedrag,
"type" => "bg" //bg staat voor internetbankieren
]);
//TODO update saldo
//TODO Checken of het saldo van de rekening onder de 20 euro komt, dan doe je een mededeling via de berichthelper.
return Redirect::create($request, $response, "/");
})->add(new Middleware());
}

View File

@ -21,6 +21,10 @@ session_start();
// Get the Slim framework settings
$settings = require __DIR__ . '/settings.php';
// Set Locale
setlocale(LC_MONETARY, 'nl_NL.UTF-8');
date_default_timezone_set('Europe/Amsterdam');
// Create the Slim application object with the settings
/**
* ==============

View File

@ -1,25 +1,19 @@
<?php include '__header.phtml'; ?>
<table class="table">
<tr>
<th>IBAN</th>
<th>Saldo</th>
<th>Rekeningtype</th>
<th>Rente</th>
</tr>
<h2 class="page-header">Mijn rekeningen<a class="btn btn-default pull-right" href="overboeking" role="button">Nieuwe overboeking</a></h2>
<?php
foreach ($rekeningen as $rekening) {
?>
<tr class="clickable" onclick="document.location.href = 'rekeningen/<?php echo $rekening['nr'] ?>'">
<td><?php echo $rekening['iban']; ?></td>
<td><?php echo "&euro;" . $rekening['saldo']; ?></td>
<td><?php echo $rekening['naam']; ?></td>
<td><?php echo $rekening['rente']; ?></td>
</tr>
<a class="clickable" onclick="document.location.href = 'rekeningen/<?php echo $rekening['nr'] ?>'"><div class="panel panel-default">
<div class="panel-body">
<h4><?php echo $rekening['naam']; ?><span class="pull-right big"><?php echo money_format('%(#1n', $rekening['saldo']); ?></span></h4>
<p><?php echo $rekening['iban']; ?></p>
</div>
</div></a>
<?php
}
?>
</table>
<?php include '__footer.phtml'; ?>

View File

@ -2,73 +2,39 @@
<html>
<head>
<meta charset="utf-8"/>
<title>InforBank - Inloggen</title>
<link href='//fonts.googleapis.com/css?family=Lato:300' rel='stylesheet' type='text/css'>
<title>Inforbank</title>
<link rel="stylesheet" href="<?= $base ?>/assets/css/login.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!--link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous" -->
<base href="<?= $base ?>">
</head>
<style>
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.btn-primary {
color: #ff6000;
background-color: #2e652c;
border-color: #2e6da4;
margin-top: 5px;
}
.form-control{
margin: 5px 0;
}
body{
color: #ff6000;
}
html, body{
height: 100%;
}
.logo{
display: block;
}
.full{
width: 100%;
height: 100%;
}
.formdiv{
background-color: #AAAAAA;
height: 100%;
padding: 10% 0 0 70px;
}
.appinfodiv{
background-color: #DDDDDD;
height: 100%;
padding: 10% 0 0 70px;
}
</style>
<body>
<div class="full">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 appinfodiv">
<div class="col-md-6 appinfodiv">
<div>
<img class="logo" alt="logo" src="assets/logo.png"/>
<h3>Welkom bij de InforBank</h1>
Bij InforBank krijg je zelfs 10% rente op betaalrekeningen.<br/><br/>
Je kunt bij InforBank ook online betalen.<br/><br/>
BIC: INFONL2N
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 formdiv">
<form class="form-signin" method="post">
<h2 class="form-signin-heading">Inloggen</h2>
<label for="inputUsername" class="sr-only">Rekeningnummer (alleen cijfers)</label>
<input type="text" id="inputUsername" name="rekeningnr" class="form-control" placeholder="012456789"/>
</div>
<div class="col-md-6 formdiv">
<div class="loginmodal-container">
<h1>Inloggen bij de Inforbank</h1><br>
<?php if ($error) {
?>
<div class="alert alert-warning" role="alert">De ingevulde gegevens zijn incorrect. Probeer het opnieuw.</div><br/>
<?php
<label for="inputPassword" class="sr-only">Pascode</label>
<input type="password" id="inputPassword" name="pascode" class="form-control" placeholder="0000"/>
<button class="btn btn-lg btn-primary btn-block" type="submit">Inloggen</button>
} ?>
<form method="post" action="">
<input type="text" name="rekeningnr" placeholder="Rekeningnummer (alleen cijfers)">
<input type="password" name="pascode" placeholder="Pascode">
<input type="submit" name="login" class="login loginmodal-submit" value="Login">
</form>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>

View File

@ -3,19 +3,38 @@
<?php
if (!$rekening) {
?>
Fout: niet jouw eigen rekening.
<div class="alert alert-danger" role="alert"><b>Fout!</b> Dit is niet een aan jouw account gekoppelde rekening.</div>
<?php
} else {
?>
<a href="overboeking">Nieuwe overboeking</a><br/><br/>
Saldo: <?php echo $rekening['saldo']?><br/>
<h2 class="page-header">Transactieoverzicht<a class="btn btn-default pull-right" href="overboeking" role="button">Nieuwe overboeking</a></h2>
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-8">
IBAN/rekeningnummer<br/>
<h4><?php echo $rekening['iban']?></h4>
</div>
<div class="col-md-2">Rentetarief<br/>
<h4><?php echo $rekening['rente']; ?>%</h4>
</div>
<div class="col-md-2">Saldo<br/>
<h4><b><?php echo money_format('%(#1n', $rekening['saldo']); ?></b></h4>
</div>
</div>
</div>
</div>
<table class="table">
<tr>
<th>Datum</th>
<th>Type</th>
<th>Code</th>
<th>Omschrijving</th>
<th>IBAN</th>
<th>Tegenrekening</th>
<th>AF/BIJ</th>
<th>Bedrag</th>
</tr>
@ -28,6 +47,7 @@ foreach ($transacties as $transactie) {
echo "<td></td>";
echo "<td>" . $transactie['type'] . "</td>\n";
echo "<td>" . $transactie['omschrijving'] . "</td>\n";
if ($transactie['van'] === $rekening['iban']) {
echo "<td>" . $transactie['naar'] . "</td>\n";
echo "<td>AF</td>\n";
@ -35,11 +55,13 @@ foreach ($transacties as $transactie) {
echo "<td>" . $transactie['van'] . "</td>\n";
echo "<td>BIJ</td>\n";
}
echo "<td>€" . $transactie['bedrag'] . "</td>\n";
echo "<td>" . money_format('%(#1n', $transactie['bedrag']) . "</td>\n";
echo "</tr>";
}
?>
} ?>
</table>
<br/>
<small>ba = betaalautomaat, bg = bankgiro/SEPA opdracht, id = Inforbank Direct Online Betalen (iDeal), sp = spoedbetaling</small>
<?php
}