Initial commit

bla
This commit is contained in:
2019-04-06 16:14:29 +02:00
parent cd762249ed
commit 57691246ed
50 changed files with 1247 additions and 0 deletions

10
dev_mvc/view/css/main.css Normal file
View File

@@ -0,0 +1,10 @@
*{
font-family: Arial, Helvetica, sans-serif;
}
header{
background-color: bisque;
}
a{
margin-right: 10px;
text-decoration: none;
}

BIN
dev_mvc/view/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -0,0 +1,51 @@
var arrWarnings = [];
var arrProblems = [];
function checkInputs(){
var boolProblem = false;
document.getElementById("jsSignupAlert").innerHTML = "";
if(document.getElementById("name").value == ""){
arrWarnings[0] = "name field is empty<br>";
boolProblem = true
}
else{
arrWarnings[0] = "";
}
if(document.getElementById("email").value == ""){
arrWarnings[1] = "email field is empty<br>";
boolProblem = true
}
else{
arrWarnings[1] = ""
}
if(document.getElementById("pass").value == ""){
arrWarnings[2] = "pass field is empty<br>";
boolProblem = true
}
else{
arrWarnings[2] = ""
}1
if(document.getElementById("pass2").value == ""){
arrWarnings[3] = "pass verification field is empty<br>";
boolProblem = true
}
else{
arrWarnings[3] = ""
}
if(document.getElementById("pass").value == document.getElementById("pass2").value){
arrWarnings[4] = "";
}
else{
arrWarnings[4] = "pass verification field doesnt match";
boolProblem = true
}
for (var i = 0; i < arrWarnings.length; i++) {
document.getElementById("jsSignupAlert").innerHTML += arrWarnings[i];
}
if(boolProblem){
document.getElementById("submitButton").disabled = true;
}
else{
document.getElementById("submitButton").disabled = false;
}
}

View File

@@ -0,0 +1,3 @@
<article>
<h1>This page does not exist!</h1>
</article>

View File

@@ -0,0 +1,7 @@
<?php
if(UserSession::isUserSignedIn()){
include("./view/pagecontent/login/content_login_succesful.php");
}else{
include("./view/pagecontent/login/content_login_unsuccesful.php");
}
?>

View File

@@ -0,0 +1,3 @@
<article>
<h1>You've been succesfully logged out</h1>
</article>

View File

@@ -0,0 +1,3 @@
<article>
<h1>Successfully registered!</h1>
</article>

View File

@@ -0,0 +1,6 @@
<?php
?>

View File

@@ -0,0 +1,3 @@
<article>
<h1>You're still signed in thanks to our cookies!</h1>
</article>

View File

@@ -0,0 +1,7 @@
<?php
if(UserSession::isUserSignedIn()){
include("./view/pagecontent/header/content_header_signedin.php");
}else{
include("./view/pagecontent/header/content_header_signedout.php");
}
?>

View File

@@ -0,0 +1,3 @@
<article>
<h1>Welkom op hForumPHP. Log in of registreer om iets te doen.</h1>
</article>

View File

@@ -0,0 +1,10 @@
<article>
<form action="?p=attempt_login" method="post">
E-mail: <input type="text" name="email"><br>
Password: <input type="password" name="password"><br>
<input type="submit">
</form>
</article>
<?php
?>

View File

@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
<?=HUtils::getSiteTitle();?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="./view/css/main.css" />
</head>
<body>
<header>
<?php
include_once("./view/pagecontent/content_header.php");
?>
</header>
<main>
<?php
//Store de geselecteerde pagina in variabele $page
$page=HUtils::getPage();
//Laad de juiste view
$path = "./view/pagecontent/content_".$page.".php";
if($page != ""){
if(file_exists($path)){
include_once($path);
}
else{
include_once("./view/pagecontent/content_404.php");
}
}
?>
</main>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<script type="text/javascript" src="./view/js/checkform.js"></script>
<article>
<form action="?p=attempt_register" method="post">
Username: <input type="text" name="name" id="name" onkeyup="checkInputs()"><br>
E-mail: <input type="text" name="email" id="email" onkeyup="checkInputs()"><br>
Password: <input type="password" name="pass" id="pass" onkeyup="checkInputs()"><br>
Verify Password: <input type="password" name="pass2" id="pass2" onkeyup="checkInputs()"><br>
<input type="submit" id="submitButton" disabled>
</form>
<div id="jsSignupAlert"></div>
</article>

View File

@@ -0,0 +1,7 @@
<?php
include_once("./controller/AssetHandler.php");
AssetHandler::printAsset("logo.png", true, 128);
?>
<nav>
<a href="?p=attempt_logout">log out</a> <a href="?p=">home</a> <a href="?p=destroy">simulate $_SESSION expiry</a>
</nav>

View File

@@ -0,0 +1,7 @@
<?php
include_once("./controller/AssetHandler.php");
AssetHandler::printAsset("logo.png", true, 128);
?>
<nav>
<a href="?p=login">log in</a> <a href="?p=register">register</a> <a href="?p=">home</a>
</nav>

View File

@@ -0,0 +1,3 @@
<article>
<h1>Successfully logged in!</h1>
</article>

View File

@@ -0,0 +1,3 @@
<article>
<h1>UNEXPECTED LOGIN ERROR. OUR CODEMONKEYS DID SOMETHING VERY WRONG :(</h1>
</article>