Loginpagina
This commit is contained in:
parent
da5ecf6f86
commit
caa567d963
35
src/Application/Login.php
Normal file
35
src/Application/Login.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Informatica Eindproject D4p
|
||||||
|
* 6in3, Stedelijk Gymnasium Nijmegen
|
||||||
|
* Docent: Hans de Wolf
|
||||||
|
*
|
||||||
|
* ==================
|
||||||
|
*
|
||||||
|
* Daniel Boutros,
|
||||||
|
* Christiaan Goossens,
|
||||||
|
* Jelmer Hinssen
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace InfD4p\Application;
|
||||||
|
|
||||||
|
use \Slim\App;
|
||||||
|
|
||||||
|
class Login {
|
||||||
|
public function __construct(App $app) {
|
||||||
|
$app->get('/login', function ($request, $response, $args) {
|
||||||
|
// Render index view
|
||||||
|
return $this->renderer->render($response, 'login.phtml', $args);
|
||||||
|
});
|
||||||
|
$app->post('/login', function ($request, $response, $args) {
|
||||||
|
// Render index view
|
||||||
|
|
||||||
|
if(isset($_POST["username"])){
|
||||||
|
echo "Jouw naam is: " . $_POST["username"] . " en je wachtwoord is: " . $_POST["password"] . "<br/>\n";
|
||||||
|
}
|
||||||
|
$newResponse = $response->withHeader('Location', 'index.php');
|
||||||
|
return $this->renderer->render($newResponse, 'login.phtml', $args);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -72,6 +72,7 @@ $container['renderer'] = function ($c) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
new InfD4p\Application\Login($app);
|
||||||
new InfD4p\Application\Main($app);
|
new InfD4p\Application\Main($app);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
56
templates/login.phtml
Normal file
56
templates/login.phtml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<title>InforBank - Inloggen</title>
|
||||||
|
<link href='//fonts.googleapis.com/css?family=Lato:300' rel='stylesheet' type='text/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" -->
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
.jumbotron{
|
||||||
|
//text-align: center;
|
||||||
|
}
|
||||||
|
.form-control{
|
||||||
|
margin: 5px 0;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
color: #ff6000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<div class = "jumbotron">
|
||||||
|
<div class = "container">
|
||||||
|
<h1>InforBank</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class = "container">
|
||||||
|
<form class = "form-signin" method = "post">
|
||||||
|
<h2 class = "form-signin-heading">Inloggen</h2>
|
||||||
|
<label for="inputUsername" class = "sr-only">Gebruikersnaam</label>
|
||||||
|
<input type = "text" id = "inputUsername" name = "username" class = "form-control" placeholder="Gebruikersnaam"/>
|
||||||
|
|
||||||
|
<label for="inputPassword" class = "sr-only">Wachtwoord</label>
|
||||||
|
<input type = "password" id = "inputPassword" name = "password" class = "form-control" placeholder="Wachtwoord"/>
|
||||||
|
<button class = "btn btn-lg btn-primary btn-block" type="submit">Inloggen</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<footer class = "footer">
|
||||||
|
Alle rechten voorbehouden
|
||||||
|
</footer>
|
||||||
|
<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>
|
Reference in New Issue
Block a user