diff --git a/website/public/img/notbad.jpg b/website/public/img/notbad.jpg new file mode 100644 index 0000000..eeea126 Binary files /dev/null and b/website/public/img/notbad.jpg differ diff --git a/website/public/js/menu.js b/website/public/js/menu.js index 56eab9b..d4471eb 100644 --- a/website/public/js/menu.js +++ b/website/public/js/menu.js @@ -1,5 +1,6 @@ $(document).ready(function() { $(".extra-menu-items").hide(); + $("#menu-back").hide(); // Show more friends $("#more-friends-click").click(function() { diff --git a/website/public/login.php b/website/public/login.php index 0018067..82570a6 100644 --- a/website/public/login.php +++ b/website/public/login.php @@ -1,13 +1,44 @@ diff --git a/website/public/register.php b/website/public/register.php new file mode 100644 index 0000000..2299cf0 --- /dev/null +++ b/website/public/register.php @@ -0,0 +1,165 @@ + + + + + + + diff --git a/website/public/styles/index.css b/website/public/styles/index.css index b4daae7..a368066 100644 --- a/website/public/styles/index.css +++ b/website/public/styles/index.css @@ -1,98 +1,118 @@ ::selection { - background: #845663; - color: white; + background: #845663; + color: white; } ::-moz-selection { - background: #845663; - color: white; + background: #845663; + color: white; } a, a:link, a:visited, a:hover, a:active { - color: inherit; - text-decoration: none; + color: inherit; + text-decoration: none; } +a.button { + background-color: #845663; + border: 2px solid black; + border-radius: 12px; + color: white; + cursor: pointer; + height: 50%; + margin: 8px 0; + padding: 14px 20px; + width: 25%; + font-family: Arial; + font-size: 16px; +} a[data-title]:hover:after, img[data-title]:hover:after, span[data-title]:hover:after, div[data-title]:hover:after{ - content: attr(data-title); - padding: 4px 4px; - color: #FFFFFF; - position: absolute; - left: 0; - top: 100%; - z-index: 20; - white-space: nowrap; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-box-shadow: 0px 0px 4px #222; - -webkit-box-shadow: 0px 0px 4px #222; - box-shadow: 0px 0px 4px #222; - background-color: #333; - font-size: 15px; - line-height: normal; - font-family: Arial, sans-serif; + content: attr(data-title); + padding: 4px 4px; + color: #FFFFFF; + position: absolute; + left: 0; + top: 100%; + z-index: 20; + white-space: nowrap; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 0px 0px 4px #222; + -webkit-box-shadow: 0px 0px 4px #222; + box-shadow: 0px 0px 4px #222; + background-color: #333; + font-size: 15px; + line-height: normal; + font-family: Arial, sans-serif; } /* Add Zoom Animation */ .animate { - animation: animatezoom 0.6s - -webkit-animation: animatezoom 0.6s; + animation: animatezoom 0.6s + -webkit-animation: animatezoom 0.6s; } /* Body */ body { - height: 100%; + height: 900px; - background-color: #B78996; - color: #333; + background-image: url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEnqKdVtLbxjKuNsCSCxFRhTOpp3Gm0gsU8bMgA_MeUYyzrUFy); + background-size: contain; + background-repeat: repeat-x; + background-attachment: fixed; - font-family: Arial, sans-serif; + /*background-color: #B78996;*/ + color: #333; + + font-family: Arial, sans-serif; } /* stijl voor alle buttons */ button { - background-color: #845663; - border: 2px solid black; - border-radius: 12px; - color: white; - cursor: pointer; - height: 50%; - margin: 8px 0; - padding: 14px 20px; - width: 25%; - font-family: Arial; - font-size: 16px; + background-color: #845663; + border: 2px solid black; + border-radius: 12px; + color: white; + cursor: pointer; + height: 50%; + margin: 8px 0; + padding: 14px 20px; + width: 25%; + font-family: Arial; + font-size: 16px; } /* The Close Button */ .close { /* Position it in the top right corner outside of the modal */ - color: white; - font-size: 100px; - font-weight: bold; - position: absolute; - right: 25px; - top: 0; + color: white; + font-size: 100px; + font-weight: bold; + position: absolute; + right: 25px; + top: 0; } /* Close button on hover */ .close:hover, .close:focus { - color: red; - cursor: pointer; + color: red; + cursor: pointer; } /* inlogform */ form { - background-color: #a87a87; + /*background-color: #a87a87;*/ border: 5px solid #325da3; + background-color: #a87a87; border-radius: 12px; - height: 50%; - margin: auto; - width: 55%; + height: 57%; + margin: 8px auto; + width: 45%; + overflow: auto; } /* inlog titel */ @@ -142,14 +162,21 @@ label { /* padding voor registreer container */ .login_containerregister { - padding: 16px; - text-align: left; + padding: 16px; + text-align: left; } /* padding voor login_containers */ .login_containerlogin { - padding: 16px; - text-align: center; + padding: 16px; + text-align: center; +} + +/* padding voor foutmelding login */ +.login_containerfault { + padding: 16px; + text-align: center; + color: red; } /* The Modal (background) */ @@ -175,12 +202,13 @@ label { margin: 5px auto; /* 15% from the top and centered */ overflow-y: auto; width: 40%; /* Could be more or less, depending on screen size */ - height: 80%; + height: 60%; + } @keyframes animatezoom { - from {transform: scale(0)} - to {transform: scale(1)} + from {transform: scale(0)} + to {transform: scale(1)} } /* datepicker */ @@ -203,6 +231,6 @@ select { } ul { - font-family: Arial; - font-size: 16px; + font-family: Arial; + font-size: 16px; } diff --git a/website/public/template_sql.php b/website/public/template_sql.php index 3ef5b97..b918f6a 100644 --- a/website/public/template_sql.php +++ b/website/public/template_sql.php @@ -4,7 +4,6 @@ query(" + SELECT + `group_page`.`name`, + `group_page`.`picture` + FROM + `group_page` + INNER JOIN + `group_member` + WHERE + `group_member`.`userID` = $userID AND + `group_member`.`groupID` = `group_page`.`groupID` AND + `group_page`.`status` != 0 + "); +} + + + +?> \ No newline at end of file diff --git a/website/queries/group_page.php b/website/queries/group_page.php new file mode 100644 index 0000000..d8bab8f --- /dev/null +++ b/website/queries/group_page.php @@ -0,0 +1,56 @@ +query(" + SELECT + `group_page`.`name`, + `group_page`.`picture`, + `group_page`.`description`, + `group_page`.`status`, + `group_page`.`creationdate` + FROM + `group_page` + WHERE + `group_page`.`groupID` = $groupID + "); +} + +function select20GroupsFromN($db, $n) { + return $db->query(" + SELECT + `group_page`.`groupID`, + `group_page`.`name`, + `group_page`.`picture`, + `group_page`.`description`, + `group_page`.`status`, + `group_page`.`creationdate` + FROM + `group_page` + ORDER BY + `group_page`.`name` ASC + LIMIT + $n, 20 + "); +} + +function select20GroupsByStatusFromN($db, $n, $status) { + return $db->query(" + SELECT + `group_page`.`groupID`, + `group_page`.`name`, + `group_page`.`picture`, + `group_page`.`description`, + `group_page`.`status`, + `group_page`.`creationdate` + FROM + `group_page` + WHERE + `group_page`.`status` = $status + ORDER BY + `group_page`.`name` ASC + LIMIT + $n, 20 + "); +} + +?> \ No newline at end of file diff --git a/website/queries/login.php b/website/queries/login.php new file mode 100644 index 0000000..c710833 --- /dev/null +++ b/website/queries/login.php @@ -0,0 +1,19 @@ +prepare(" + SELECT + `password`, + `userID` + FROM + `user` + WHERE + `username` LIKE :username + "); + + $stmt->bindParam(":username", $_POST["uname"]); + $stmt->execute(); + return $stmt->fetch(PDO::FETCH_ASSOC); +} + +?> diff --git a/website/queries/register.php b/website/queries/register.php new file mode 100644 index 0000000..9881872 --- /dev/null +++ b/website/queries/register.php @@ -0,0 +1,62 @@ +prepare(" + SELECT + `username` + FROM + `user` + WHERE + `username` LIKE :username + "); + + $stmt->bindParam(":username", $_POST["username"]); + $stmt->execute(); + return $stmt->rowCount(); + +} + +function getExistingEmail() { + $stmt = $GLOBALS["db"]->prepare(" + SELECT * FROM `user` WHERE `email` = :email + "); + + $stmt->bindParam(":email", $_POST["email"]); + $stmt->execute(); + return $stmt->rowCount(); +} + +function registerAccount() { + $stmt = $GLOBALS["db"]->prepare(" + INSERT INTO + `user`(fname, + lname, + birthdate, + username, + password, + location, + email) + VALUES( + :fname, + :lname, + :bday, + :username, + :password, + :location, + :email + )"); + + $hash=password_hash($_POST["password"].(strtolower($_POST["username"])), PASSWORD_DEFAULT); + + $stmt->bindParam(":fname", $_POST["name"]); + $stmt->bindParam(":lname", $_POST["surname"]); + $stmt->bindParam(":bday", $_POST["bday"]); + $stmt->bindParam(":username", $_POST["username"]); + $stmt->bindParam(":password", $hash); + $stmt->bindParam(":location", $_POST["location"]); + $stmt->bindParam(":email", $_POST["email"]); + + $stmt->execute(); + $stmt->rowCount(); +} +?> diff --git a/website/queries/settings.php b/website/queries/settings.php index 1d47d32..c59ff7f 100644 --- a/website/queries/settings.php +++ b/website/queries/settings.php @@ -10,9 +10,9 @@ function getSettings() { `birthdate`, `bio`, `profilepicture` - FROM + FROM `user` - WHERE + WHERE `userID` = :userID "); diff --git a/website/views/login-view.php b/website/views/login-view.php index 7ee3d66..e70d96b 100644 --- a/website/views/login-view.php +++ b/website/views/login-view.php @@ -1,256 +1,49 @@ - - -
MyHyvesbook+
-
+" + return= $correct method="post">

Welkom bij MyHyvesbook+

+
+ >
+
+ >
+ +
+ +
+
- + Registreer een account
- -
- -
- - - - diff --git a/website/views/login_head.php b/website/views/login_head.php index 6111b5d..2283b7d 100644 --- a/website/views/login_head.php +++ b/website/views/login_head.php @@ -5,6 +5,4 @@ type="text/css" href="styles/index.css"> - - diff --git a/website/views/menu.php b/website/views/menu.php index bf8b1d7..5486cd6 100644 --- a/website/views/menu.php +++ b/website/views/menu.php @@ -4,64 +4,54 @@ Vrienden
@@ -69,44 +59,57 @@ Groepen
diff --git a/website/views/register-view.php b/website/views/register-view.php new file mode 100644 index 0000000..3ccc978 --- /dev/null +++ b/website/views/register-view.php @@ -0,0 +1,133 @@ +
+ MyHyvesbook+ +
+ + +
" + return= $correct + method="post"> +

Registreer uw account

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ Login met een account +