Merge branch 'master' into hendrik-testing

This commit is contained in:
Hendrik
2017-01-26 13:02:35 +01:00
71 changed files with 2479 additions and 821 deletions

View File

@@ -1,16 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Admin Panel</title>
<script src="/js/admin.js" charset="utf-8"></script>
<?php
include_once("../queries/user.php");
include_once("../queries/group_page.php");
?>
</head>
<body>
<script src="js/admin.js" charset="utf-8"></script>
<?php
require_once ("../queries/user.php");
require_once ("../queries/group_page.php");
?>
<!-- function test_input taken from http://www.w3schools.com/php/php_form_validation.asp -->
<?php
$search = "";
@@ -66,112 +58,97 @@ $listm = $currentpage * $perpage;
<div class="content">
<div class="platform admin-panel">
<div class="admin-title">
<h1>User Management Panel</h1>
</div> <br>
<h5>Zoek naar gebruikers of groepen:</h5>
<div class="admin-options">
<form class="admin-searchform"
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
method="get">
<div class="admin-searchbar">
<h2>Search</h2>
<input type="text"
name="search"
class="admin-searchinput"
value="<?php echo $search;?>"> <br>
<input type="submit" value="Search">
Zoek: <input type="text"
name="search"
class="admin-searchinput"
placeholder="Naam"
value="<?php echo $search;?>">
Op: <select name="pagetype" id="pagetype" onchange="changeFilter()">
<option value="user"
<?php if (isset($pagetype) && $pagetype=="user") echo "selected";?>>
Gerbuiker
</option>
<option value="group"
<?php if (isset($pagetype) && $pagetype=="group") echo "selected";?>>
Groep
</option>
</select>
<button type="submit"><i class="fa fa-search"></i></button>
</div>
<div class="admin-filter" id="admin-filter">
<h2>Show:</h2>
<input type="checkbox" name="status[]" id="normal" value="user"
<?php if (in_array("user", $status)) echo "checked";?>>
<div id="admin-filter">
<h5>Type gebruiker:</h5>
<input type="checkbox"
name="status[]"
id="all"
value="all"
<?php if (in_array("all", $status)) echo "checked";?>>
<label for="normal">Allemaal</label><br>
<input type="checkbox"
name="status[]"
id="normal"
value="user"
<?php if (in_array("user", $status)) echo "checked";?>>
<label for="normal">Normal</label><br>
<input type="checkbox" name="status[]" id="frozen" value="frozen"
<?php if (in_array("frozen", $status)) echo "checked";?>>
<input type="checkbox"
name="status[]"
id="frozen"
value="frozen"
<?php if (in_array("frozen", $status)) echo "checked";?>>
<label for="frozen">Frozen</label><br>
<input type="checkbox" name="status[]" id="banned" value="banned"
<?php if (in_array("banned", $status)) echo "checked";?>>
<input type="checkbox"
name="status[]"
id="banned"
value="banned"
<?php if (in_array("banned", $status)) echo "checked";?>>
<label for="banned">Banned</label><br>
<input type="checkbox" name="status[]" id="admin" value="admin"
<?php if (in_array("admin", $status)) echo "checked";?>>
<input type="checkbox"
name="status[]"
id="admin"
value="admin"
<?php if (in_array("admin", $status)) echo "checked";?>>
<label for="admin">Admin</label><br>
<input type="checkbox" name="status[]" id="unvalidated" value="unconfirmed"
<?php if (in_array("unconfirmed", $status)) echo "checked";?>>
<input type="checkbox"
name="status[]"
id="unvalidated"
value="unconfirmed"
<?php if (in_array("unconfirmed", $status)) echo "checked";?>>
<label for="unvalidated">Unvalidated</label><br>
<input type="checkbox" name="status[]" id="owner" value="owner"
<?php if (in_array("owner", $status)) echo "checked";?>>
<input type="checkbox"
name="status[]"
id="owner"
value="owner"
<?php if (in_array("owner", $status)) echo "checked";?>>
<label for="owner">Owner</label>
</div>
<div class="admin-groupfilter" id="admin-groupfilter">
<h2>Show:</h2>
<input type="checkbox" name="groupstatus[]" id="hidden" value="hidden"
<?php if (in_array("hidden", $groupstatus)) echo "checked";?>>
<div id="admin-groupfilter">
<h5>Type groep:</h5>
<input type="checkbox" name="groupstatus[]" id="all" value="all"
<?php if (in_array("all", $groupstatus)) echo "checked";?>>
<label for="hidden">Allemaal</label><br>
<input type="checkbox" name="groupstatus[]" id="hidden" value="0"
<?php if (in_array("0", $groupstatus)) echo "checked";?>>
<label for="hidden">Hidden</label><br>
<input type="checkbox" name="groupstatus[]" id="public" value="public"
<?php if (in_array("public", $groupstatus)) echo "checked";?>>
<input type="checkbox" name="groupstatus[]" id="public" value="1"
<?php if (in_array("1", $groupstatus)) echo "checked";?>>
<label for="public">Public</label><br>
<input type="checkbox" name="groupstatus[]" id="membersonly" value="membersonly"
<?php if (in_array("membersonly", $groupstatus)) echo "checked";?>>
<input type="checkbox" name="groupstatus[]" id="membersonly" value="2"
<?php if (in_array("2", $groupstatus)) echo "checked";?>>
<label for="membersonly">Members-only</label><br>
</div>
<div class="admin-filtertype">
<h2>Page Type:</h2>
<input type="radio" name="pagetype" id="user" value="user"
<?php if (isset($pagetype) && $pagetype=="user") echo "checked";?>
onchange="changeFilter()">
<label for="user">Users</label><br>
<input type="radio" name="pagetype" id="group" value="group"
<?php if (isset($pagetype) && $pagetype=="group") echo "checked";?>
onchange="changeFilter()">
<label for="group">Groups</label>
</div>
</form>
<div class="admin-batchactions" id="admin-batchactions">
<h2>Batch Actions: </h2>
<form class="admin-batchform"
id="admin-batchform"
action="<?php htmlspecialchars(basename($_SERVER['REQUEST_URI'])) ?>"
method="post">
<input type="radio" name="batchactions" id="freeze" value="frozen">
<label for="freeze">Freeze</label><br>
<input type="radio" name="batchactions" id="ban" value="banned">
<label for="ban">Ban</label><br>
<input type="radio" name="batchactions" id="restore" value="user">
<label for="restore">Restore</label><br><br>
<input type="submit" value="Confirm">
</form>
</div>
<div class="admin-groupbatchactions" id="admin-groupbatchactions">
<h2>Batch Actions: </h2>
<form class="admin-groupbatchform"
id="admin-groupbatchform"
action="<?php htmlspecialchars(basename($_SERVER['REQUEST_URI'])) ?>"
method="post">
<input type="radio" name="groupbatchactions" id="hide" value="hidden">
<label for="hide">Hide</label><br>
<input type="radio" name="groupbatchactions" id="public" value="public">
<label for="public">Public</label><br>
<input type="radio" name="groupbatchactions" id="membersonly" value="membersonly">
<label for="membersonly">Member</label><br><br>
<input type="submit" value="Confirm">
</form>
</div>
</div>
<br>
<div class="admin-users">
<div class="admin-usertitle">
<div class="admin-userheading">
<h2>Users:</h2>
</div>
<div class="admin-pageui">
</div>
<div class="admin-users">
<div class="admin-usertitle">
<h4>Resultaat:</h4>
<span style="float: right">
<?php
if ($pagetype == "user") {
$pages = countSomeUsersByStatus($search, $status);
@@ -182,10 +159,9 @@ $listm = $currentpage * $perpage;
$mincount = min($listm, $countresults);
$minlist = min($listn + 1, $countresults);
?>
<p class="pagenumber">Current page:</p>
<form class="admin-pageselector"
action="<?php htmlspecialchars(basename($_SERVER['REQUEST_URI'])) ?>"
method="post">
Pagina: <form class="admin-pageselector"
action="<?php htmlspecialchars(basename($_SERVER['REQUEST_URI'])) ?>"
method="post">
<select class="admin-pageselect"
name="pageselect"
onchange="this.form.submit()"
@@ -201,41 +177,45 @@ $listm = $currentpage * $perpage;
?>
</select>
</form>
<p class="entriesshown">
<?php
echo "Showing results $minlist to $mincount out of $countresults";
?>
</div>
</div> <br>
<table class="usertable">
<tr>
<th class="table-checkbox">
<input type="checkbox" id="checkall" name="checkall" onchange="checkAll(this)">
</th>
<th class="table-username">User</th>
<th class="table-status">Status</th>
<th class="table-comment">Comment</th>
<th class="table-action">Action</th>
</tr>
<!-- Table construction via php PDO. -->
<?php
$listn = ($currentpage-1) * $perpage;
$listm = $currentpage * $perpage;
echo "$minlist tot $mincount ($countresults totaal)";
?>
</span>
<form
id="admin-batchform"
action="<?php htmlspecialchars(basename($_SERVER['REQUEST_URI'])) ?>"
method="post">
if ($pagetype == 'user') {
$q = searchSomeUsersByStatus($listn, $perpage, $search, $status);
<button type="submit" name="batchactions" id="freeze" value="frozen">Bevries</button>
<button type="submit" name="batchactions" id="ban" value="banned">Ban</button>
<button type="submit" name="batchactions" id="restore" value="user">Activeer</button>
</form>
</div>
<table class="usertable">
<tr>
<th><input type="checkbox" id="checkall" name="checkall" onchange="checkAll(this)"></th>
<th class="table-username">Gebruikersnaam</th>
<th class="table-status">Status</th>
<th class="table-comment">Aantekening</th>
<th class="table-action">Actie</th>
</tr>
while($user = $q->fetch(PDO::FETCH_ASSOC)) {
$userID = $user['userID'];
$username = $user['username'];
$role = $user['role'];
$bancomment = $user['bancomment'];
$thispage = htmlspecialchars(basename($_SERVER['REQUEST_URI']));
$function = "checkCheckAll(document.getElementById('checkall'))";
<!-- Table construction via php PDO. -->
<?php
$listn = ($currentpage-1) * $perpage;
$listm = $currentpage * $perpage;
echo("
if ($pagetype == 'user') {
$q = searchSomeUsersByStatus($listn, $listm, $search, $status);
while($user = $q->fetch(PDO::FETCH_ASSOC)) {
$userID = $user['userID'];
$username = $user['username'];
$role = $user['role'];
$bancomment = $user['bancomment'];
$thispage = htmlspecialchars(basename($_SERVER['REQUEST_URI']));
$function = "checkCheckAll(document.getElementById('checkall'))";
echo("
<tr>
<td><input type='checkbox'
name='checkbox-user[]'
@@ -252,9 +232,9 @@ $listm = $currentpage * $perpage;
action='$thispage'
method='post'>
<select class='action' name='actions'>
<option value='frozen'>Freeze</option>
<option value='frozen'>Bevries</option>
<option value='banned'>Ban</option>
<option value='user'>Restore</option>
<option value='user'>Activeer</option>
</select>
<input type='hidden' name='userID' value='$userID'>
<input type='submit' value='Confirm'>
@@ -262,19 +242,19 @@ $listm = $currentpage * $perpage;
</td>
</tr>
");
}
} else {
$q = searchSomeGroupsByStatus($listn, $perpage, $search, $groupstatus);
}
} else {
$q = searchSomeGroupsByStatus($listn, $listm, $search, $groupstatus);
while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
$groupID = $group['groupID'];
$name = $group['name'];
$role = $group['status'];
$description = $group['description'];
$thispage = htmlspecialchars(basename($_SERVER['REQUEST_URI']));
$function = "checkCheckAll(document.getElementById('checkall'))";
while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
$groupID = $group['groupID'];
$name = $group['name'];
$role = $group['status'];
$description = $group['description'];
$thispage = htmlspecialchars(basename($_SERVER['REQUEST_URI']));
$function = "checkCheckAll(document.getElementById('checkall'))";
echo("
echo("
<tr>
<td><input type='checkbox'
name='checkbox-group[]'
@@ -291,9 +271,9 @@ $listm = $currentpage * $perpage;
action='$thispage'
method='post'>
<select class='action' name='actions'>
<option value='hidden'>Hide</option>
<option value='public'>Public</option>
<option value='membersonly'>Members</option>
<option value='0'>Hide</option>
<option value='1'>Public</option>
<option value='2'>Members</option>
</select>
<input type='hidden' name='groupID' value='$groupID'>
<input type='submit' value='Confirm'>
@@ -301,12 +281,12 @@ $listm = $currentpage * $perpage;
</td>
</tr>
");
}
}
?>
</table>
</div>
}
?>
</table>
</div>
</div>
</div>
</body>
</html>
</html>

View File

@@ -1,6 +1,6 @@
<div class="content">
<div class="chat">
<nav class="nav-list chat-left left platform chat-recent">
<nav class="nav-list platform" id="chat-recent-panel">
<h5>Chats</h5>
<ul>
<?php
@@ -16,8 +16,9 @@
// Set default values of a friend.
$username = $friend["username"];
$name = $friend["fullname"];
$userID = $friend["userID"];
$pf = "img/notbad.jpg";
$pf = "img/avatar-standard.png";
// Change values if needed.
if (!empty($friend["profilepicture"]))
@@ -28,17 +29,24 @@
<li class='friend-item' id='friend-item-$userID' onclick='switchUser(\"$userID\")'>
<div class='friend'>
<img alt='PF' class='profile-picture' src='$pf'/>
$username
<div class='friend-name'>
$name<br/>
<span style='color: #666'>$username</span>
</div>
</div>
</li>
";
";
}
if (isset($_GET["username"]) && $_GET["username"] != "") {
$chatID = $_GET["username"];
echo "<script>$(document).ready(function(){switchUser('$chatID')});</script>";
}
?>
</ul>
</nav>
<div class="chat-right">
<div id="chat-history" class="chat-history platform">
</div>
<div id="chat-history" class="chat-history platform">
</div>
<div>
<form id="lastIDForm">
<input type="hidden"
id="lastID"

View File

@@ -2,6 +2,7 @@
<title>MyHyvesbook+</title>
<!-- Add your javascript files here. -->
<script src="js/jquery.js"></script>
<script src="js/main.js"></script>
<script src="js/header.js"></script>
<script src="js/menu.js"></script>
<script src="js/notifications.js"></script>

View File

@@ -14,8 +14,9 @@ $userinfo = getHeaderInfo();
placeholder="Zoek naar wat je wil"
required
/>
<input type="submit"
value="Zoek"/>
<button type="submit">
<i class="fa fa-search"></i>
</button>
</form>
</div>
<div class="right profile-menu">

View File

@@ -0,0 +1,3 @@
<?php
echo json_encode(selectAllFriends($_SESSION["userID"])->fetchAll());

View File

@@ -7,8 +7,9 @@
<h1>Welkom bij MyHyvesbook+</h1>
<!-- Login content -->
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
return= $correct
method="post">
return=$correct
method="post"
name="login">
<!-- Login name -->
<div class="login_containerlogin">
@@ -37,15 +38,79 @@
<!-- Button for logging in -->
<div class="login_containerlogin">
<button type="submit"
value="Login"
name="submit"
id="frm1_submit">
Login
value="login"
name="submit"
id="frm1_submit">
Inloggen
</button>
</div>
</form>
</div>
<!-- Button for going to the register screen -->
<div class="login_containerlogin">
<a href="https://myhyvesbookplus.nl/register" class="button">Registreer een account</a>
<a href="https://myhyvesbookplus.nl/register" class="button">Registreer een account</a>
<!-- Trigger/Open The Modal -->
<button id="myBtn" class="button">Wachtwoord vergeten</button>
<!-- The Modal -->
<div id="myModal" class="modal">
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
return= $correct
method="post"
name="forgotPassword">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">&times;</span>
<h3>Voer uw emailadres in</h3>
</div>
<div class="modal-body">
<input type="text"
placeholder="Voer uw email in"
name="forgotEmail"
title="Voer een email in">
</div>
<div class="modal-footer">
<div class="login_containerfault"><span><?php echo $resetErr; ?></span></div>
<button type="submit"
value="reset"
name="submit"
id="frm1_submit">
Reset password
</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script>
// Get the modal
var modal = document.getElementById('myModal');
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks the button, open the modal
btn.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>

View File

@@ -7,6 +7,7 @@
<link rel="stylesheet"
type="text/css"
href="styles/index.css">
<script src="/js/jqeury.js"></script>
<script src="/js/registerAndLogin.js"></script>
<script src="js/jquery.js"></script>
<script src="js/registerAndLogin.js"></script>
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>

View File

@@ -1,148 +1,25 @@
<nav class="menu">
<section id="friends-menu-section platform">
<section id="friends-menu-section">
<h4>
Vrienden
</h4>
<ul class="nav-list">
<?php
// Load file.
require_once("../queries/friendship.php");
require_once("../queries/user.php");
// Get all the friends of a user.
$friends = selectAllFriends($_SESSION["userID"]);
$i = 0;
// Print all the users.
while($friend = $friends->fetch(PDO::FETCH_ASSOC)) {
$i ++;
// Set default values of a friend.
$username = $friend["username"];
$extraItem = "";
$pf = "img/notbad.jpg";
// Change values if needed.
if (!empty($friend["profilepicture"]))
$pf = $friend["profilepicture"];
if ($i > 5)
$extraItem = "extra-menu-items";
// Echo the friend.
echo "
<li class='friend-item $extraItem'>
<form action='profile.php' method='get'>
<button type='submit'
name='username'
value='$username'>
<div class='friend'>
<img alt='PF' class='profile-picture' src='$pf'/>
$username
</div>
</button>
</form>
</li>
";
}
$randomUser = selectRandomNotFriendUser($_SESSION["userID"])["username"];
echo "
<li class='friend-item'>
<form action='/profile' method='get'>
<button type='submit'
name='username'
value='$randomUser'>
<div class='friend'>
Klik hier voor een nieuw vriendje :)
</div>
</button>
</form>
</li>
";
if ($i > 5) {
$i -= 5;
echo "
<li class='more-item' id='more-friends-click'>
En nog $i anderen...
</li>
";
}
?>
<ul id="menu-friends-list" class="nav-list">
</ul>
<h4><form action="search.php">
<input type="hidden"
value="friends"
name="filter" />
<button value=""
name="search">
Alle vrienden...
</button>
</form></h4>
</section>
<section id="groups-menu-section">
<h4>
Groepen
</h4>
<ul class="nav-list">
<?php
// Load file.
include_once("../queries/group_member.php");
// Get all the friends of a user.
$groups = selectAllGroupsFromUser($_SESSION["userID"]);
$i = 0;
// Print all the users.
while($group = $groups->fetch(PDO::FETCH_ASSOC)) {
$i ++;
// Set default values of a friend.
$name = $group["name"];
$extraItem = "";
$picture = "img/notbad.jpg";
// Change values if needed.
if (!empty($group["picture"]))
$picture = $group["picture"];
if ($i > 3)
$extraItem = "extra-menu-items";
// Echo the friend.
echo "
<li class='group-item'>
<form action='group.php' method='get'>
<button type='submit'
name='groupname'
value='$name'>
<div class='group'>
<img alt='PF' class='group-picture' src='$picture'/>
$name
</div>
</button>
</form>
</li>
";
}
if ($i == 0) {
echo "<li class='group-item'>
<div class='group'>
Je hoort nergens bij.
</div>
</li>";
} else if ($i > 3) {
$i -= 3;
echo "
<li class='more-item' id='more-groups-click'>
En nog $i andere...
</li>
";
}
?>
<ul id="menu-groups-list" class="nav-list">
</ul>
</section>
<section>
<ul>
<li class="more-item" id="menu-back">
Ga terug
</li>
</ul>
</section>
</nav>
</nav>

View File

@@ -0,0 +1,23 @@
<?php
function messagePage(string $content) {
$webpage = ("
<!DOCTYPE html>
<html>
<head>
<style>
@import url(styles/main.css);
@import url(styles/settings.css);
@import url(styles/resetpassword.css);
</style>
</head>
<body>
<div class='password-change'>
<div class='top-logo'><a href='login.php'><img src='img/top-logo.png' alt='MyHyvesbook+'/></a></div>
<div class='item-box platform'>$content</div>
</div>
</body>
</html>
");
echo $webpage;
}

View File

@@ -5,11 +5,19 @@
<a href="profile.php"><i class="fa fa-user" data-title="Profiel"></i></a>
<a href="logout.php"><i class="fa fa-sign-out" data-title="Uitloggen"></i></a>
</section>
<section id="notifocationCenter">
<section id="friend-request-section">
<h4>
Vriendchapsverzoeken
</h4>
<ul class="nav-list" id="friendrequestslist">
<ul class="nav-list" id="friend-requests-list">
</ul>
</section>
<section id="unread-messages-section">
<h4>
Nieuwe berichten
</h4>
<ul class="nav-list" id="unread-chat-list">
</ul>
</section>

View File

@@ -0,0 +1,52 @@
<?php
$postID = $_GET['postID'];
$post = selectPostById($postID)->fetch(PDO::FETCH_ASSOC);
$fullname = $post['fname'] . " " . $post['lname'] . " (" . $post['username'] . ")";
echo("
<div class='post-header header'>
<h4>" . $post['title'] . "</h4>
<span class='postinfo'>
gepost door $fullname,
<span class='posttime' title='" . $post['creationdate'] . "'>
" . nicetime($post['creationdate']) . "
</span>
</span>
</div>
<div class='post-content'>
<p>" . $post['content'] . "</p>
</div>
"); ?>
<div class='post-comments'>
<div class="commentfield">
<form name="newcomment" method="post">
<textarea placeholder="Laat een reactie achter..."></textarea> <br>
<input type="submit" value="Reageer!">
</form>
</div>
<?php
$q = selectCommentsByPostId($postID);
while($comment = $q->fetch(PDO::FETCH_ASSOC)) {
$commentauthor = $comment['fname'] . " " . $comment['lname'] . " (" . $comment['username'] . ")";
$commentdate = $comment['creationdate'];
$commentnicetime = nicetime($commentdate);
$commentcontent = $comment['content'];
echo("
<div class='comment'>
<div class='commentinfo'>
$commentauthor
<span class='commentdate', title='$commentdate'>
$commentnicetime
</span>
</div>
<div class='commentcontent'>
$commentcontent
</div>
</div>
");
} ?>
</div>

View File

@@ -1,11 +1,13 @@
<div class="content">
<div class="profile-box platform">
<img class="left profile-picture" src="<?php echo $user["profilepicture"] ?>">
<div class="profile-button">
<p><img src="/img/add-friend.png"> Als vriend toevoegen</p>
<div class="friend-button-container">
</div>
<h1 class="profile-username"><?=$user["username"]?></h1>
<h5 class="profile-username"><?= $user["fname"]?> <?=$user["lname"]?></h5>
<h1 class="profile-username"><?= $user["fname"]?> <?=$user["lname"]?></h1>
<h5 class="profile-username"><?=$user["username"]?></h5>
<p><?=$user["bio"]?></p>
</div>
@@ -14,7 +16,7 @@
<p>
<?php
while($friend = $profile_friends->fetch()) {
echo "<a href='/profile/${friend["username"]}/' data-title='${friend["username"]}'><img class='profile-picture' src='${friend["profilepicture"]}' alt='${friend["username"]}'s profielfoto></a>";
echo "<a href='profile.php?username=${friend["username"]}' data-title='${friend["username"]}'><img class='profile-picture' src='${friend["profilepicture"]}' alt='${friend["username"]}'s profielfoto></a>";
}
@@ -47,7 +49,7 @@
<div class="post platform">
<form>
<input type="text" class="newpost" placeholder="Titel">
<textarea class="newpost">Schrijf een berichtje...</textarea>
<textarea class="newpost" placeholder="Schrijf een berichtje..."></textarea>
<input type="submit" value="Plaats!">
</form>
</div>
@@ -56,14 +58,32 @@
while($post = $posts->fetch()) {
$nicetime = nicetime($post["creationdate"]);
$postID = $post["postID"];
echo "
<div class='post platform'>
<div class='post platform' onclick='requestPost(this)'>
<h2>${post["title"]}</h2>
<p>${post["content"]}</p>
<p class=\"subscript\">${nicetime} geplaatst.</p>
<p class=\"subscript\" title='" . $post["creationdate"] ."'>${nicetime} geplaatst.</p>
<form>
<input type='hidden'
name='postID'
value='$postID'
/>
</form>
</div>
";
}
?>
</div>
<div class="modal">
<div class="modal-content platform">
<div class="modal-close">
&times;
</div>
<div class="modal-response" id="modal-response">
<span class="modal-default">Aan het laden...</span>
</div>
</div>
</div>
</div>

View File

@@ -41,11 +41,12 @@
<!-- Register birthday -->
<div class="login_containerregister">
<label><b>Geboortedatum</b></label>
<input type="date"
<input type="text"
name="bday"
value="<?php echo $bday ?>"
id="bday"
placeholder="01/01/1900"
placeholder="1996/01/01"
data-fv-date-max=""
>
*<span class="error"> <?php echo $bdayErr;?></span>
</div>
@@ -95,7 +96,7 @@
<!-- Register location -->
<div class="login_containerregister">
<label><b>Woonplaats</b></label>
<label><b>Locatie</b></label>
<input type="text"
placeholder="Voer uw woonplaats in"
name="location"
@@ -117,18 +118,23 @@
*<span class="error"> <?php echo $emailErr;?></span>
</div>
<!-- Button for registering -->
<div class="login_containerregister">
<div class="g-recaptcha" data-sitekey="6Lc72xIUAAAAADumlWetgENm7NGd9Npyo0c_tYYQ"></div>
<span class="error"> <?php echo $captchaErr;?></span>
</div>
<!-- Button for registering -->
<div class="login_containerlogin">
<!-- Button for going back to login screen -->
<a href="https://myhyvesbookplus.nl/login.php" class="button">Annuleren</a>
<button type="submit"
value="Registreer uw account"
name="Submit"
id="frm1_submit">
Registreer
</button>
</div>
</div>
</form>
<div class="login_containerlogin">
<!-- Button for going back to login screen -->
<a href="https://myhyvesbookplus.nl/login.php" class="left-arrow">Login</a>
</div>
</div>

View File

@@ -0,0 +1,38 @@
<?php
function passwordResetFields() {
$username = $_GET['u'];
$hash = $_GET['h'];
$content ="
<form class='settings' method = 'post' >
<h5 > Voer een nieuw wachtwoord in </h5 >
<input type = 'hidden'
name = 'u'
value = '$username'
>
<input type = 'hidden'
name = 'h'
value = '$hash'
>
<ul >
<li >
<label > Nieuw wachtwoord </label >
<input type = 'password'
name = 'password'
placeholder = 'Nieuw wachtwoord'
>
</li >
<li >
<label > Bevestig wachtwoord </label >
<input type = 'password'
name = 'password-confirm'
placeholder = 'Bevestig wachtwoord'
>
</li >
<li >
<label ></label >
<button type = 'submit' > Verander wachtwoord </button >
</li >
</ul >
</form >";
return $content;
}

View File

@@ -1,6 +1,16 @@
<?php
$search = "";
$filter = "all";
$user_perpage = $group_perpage = 20;
$user_currentpage = $group_currentpage = 1;
if (isset($_GET['user-pageselect'])) {
$user_currentpage = $_GET['user-pageselect'];
}
if (isset($_GET['group-pageselect'])) {
$group_currentpage = $_GET['group-pageselect'];
}
if (isset($_GET['search'])) {
$search = test_input($_GET['search']);
@@ -9,18 +19,26 @@ if (isset($_GET['search'])) {
if (isset($_GET['filter'])) {
$filter = $_GET['filter'];
}
$user_n = ($user_currentpage - 1) * $user_perpage;
$user_count = countSomeUsers($search)->fetchColumn();
$group_n = ($group_currentpage - 1) * $group_perpage;
$group_count = countSomeGroups($search)->fetchColumn();
?>
<div class="content">
<div class="platform">
<form class="search-form" action="search.php" method="get">
<form class="search-form"
id="search-form"
action="search.php"
method="get">
<label>
Zoek:
</label>
<input type="text"
name="search"
placeholder="zoek"
required
placeholder="Zoek"
value=<?php echo "$search";?>
>
<label for="filter">
@@ -40,17 +58,36 @@ if (isset($_GET['filter'])) {
<?php if ($filter == "friends") echo "selected";?>>
Vrienden</option>
</select>
<input type="submit"
<input onclick="document.getElementById('user-pageselect').value = 1;
document.getElementById('group-pageselect').value = 1"
type="submit"
value="Zoek"
/>
>
</form>
</div>
<div class="platform item-box searchleft" id="search-friends-output">
<h4>Gebruikers</h4>
<select class="user-pageselect"
name="user-pageselect"
id="user-pageselect"
form="search-form"
onchange="this.form.submit()">
<?php
for ($i=1; $i <= ceil($user_count / $user_perpage); $i++) {
if ($user_currentpage == $i) {
echo "<option value='$i' selected>$i</option>";
} else {
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
<ul class='nav-list'>
<?php
$q = searchSomeUsers(0, 20, $search);
$q = searchSomeUsers($user_n, $user_perpage, $search);
while ($user = $q->fetch(PDO::FETCH_ASSOC)) {
$username = $user['username'];
@@ -59,7 +96,7 @@ if (isset($_GET['filter'])) {
$lname = $user['lname'];
echo("
<a href='https://myhyvesbookplus.nl/profile/$username/'>
<a href='https://myhyvesbookplus.nl/profile?username=$username'>
<li class='search-item'>
<div class='friend'>
<img class='profile-picture'
@@ -77,17 +114,34 @@ if (isset($_GET['filter'])) {
<div class="platform item-box searchright" id="search-group-output">
<h4>Groepen</h4>
<select class="group-pageselect"
name="group-pageselect"
id="group-pageselect"
form="search-form"
onchange="this.form.submit()">
<?php
for ($i=1; $i <= ceil($group_count / $group_perpage); $i++) {
if ($group_currentpage == $i) {
echo "<option value='$i' selected>$i</option>";
} else {
echo "<option value='$i'>$i</option>";
}
}
?>
</select>
<ul class="nav-list">
<?php
$q = searchSomeGroups(0, 20, $search);
$q = searchSomeGroups($group_n, $user_perpage, $search);
while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
$groupname = $group['name'];
$grouppic = $group['picture'];
echo("
<a href='https://myhyvesbookplus.nl/group/$groupname/'>
<a href='https://myhyvesbookplus.nl/group?groupName=$groupname'>
<li class='search-item'>
<div class='group'>
<img class='group-picture'

View File

@@ -6,9 +6,9 @@ $settings = getSettings();
<div class="settings">
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
echo "<div class='platform settings-message ". $result->getClass()."'>".
$result->getMessage().
"</div>";
echo "<div class='platform settings-message $alertClass '>
$alertMessage
</div>";
}
?>
<form class="settings-profile platform" method="post">
@@ -81,7 +81,8 @@ $settings = getSettings();
<label>Selecteer foto</label>
<input type="file"
name="pp"
accept="image/jpeg,image/gif,image/png"
accept="image/*"
size="4000000"
>
</li>
<li>