Merge branch 'master' into kevin-prototype
This commit is contained in:
@@ -16,7 +16,6 @@ while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
$name = $group['name'];
|
||||
$role = $group['status'];
|
||||
$description = $group['description'];
|
||||
$function = "checkCheckAll(document.getElementById('checkall'))";
|
||||
|
||||
echo("
|
||||
<tr>
|
||||
@@ -25,15 +24,14 @@ while ($group = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
class='checkbox-list'
|
||||
value='$groupID'
|
||||
form='admin-groupbatchform'
|
||||
onchange='$function'>
|
||||
onchange='checkCheckAll();'>
|
||||
</td>
|
||||
<td>$name</td>
|
||||
<td>$role</td>
|
||||
<td>$description</td>
|
||||
<td>
|
||||
<form class='admin-groupaction'
|
||||
action='API/adminChangeUser.php'
|
||||
method='post'>
|
||||
onsubmit=\"adminUpdate(this); return false;\">
|
||||
<select class='action' name='actions'>
|
||||
<option value='hidden'>Hidden</option>
|
||||
<option value='public'>Public</option>
|
||||
|
||||
@@ -5,27 +5,26 @@ if ($pagetype == "user") {
|
||||
$pages = countSomeGroupsByStatus($search, $groupstatus);
|
||||
}
|
||||
$countresults = $pages->fetchColumn();
|
||||
$mincount = min($listm, $countresults);
|
||||
$minlist = min($listn + 1, $countresults);
|
||||
|
||||
?>
|
||||
Pagina: <form class="admin-pageselector"
|
||||
action="<?php htmlspecialchars(basename($_SERVER['REQUEST_URI'])) ?>"
|
||||
method="post">
|
||||
<select class="admin-pageselect"
|
||||
name="pageselect"
|
||||
onchange="this.form.submit()"
|
||||
value="">
|
||||
<?php
|
||||
for ($i=1; $i <= ceil($countresults / $perpage); $i++) {
|
||||
if ($currentpage == $i) {
|
||||
echo "<option value='$i' selected>$i</option>";
|
||||
} else {
|
||||
echo "<option value='$i'>$i</option>";
|
||||
}
|
||||
Pagina:
|
||||
<select class="admin-pageselect"
|
||||
name="currentpage"
|
||||
id="currentpage"
|
||||
form="admin-searchform"
|
||||
onchange="adminSearch();">
|
||||
<?php
|
||||
for ($i=1; $i <= ceil($countresults / $entries); $i++) {
|
||||
if ($currentpage == $i) {
|
||||
echo "<option value='$i' selected>$i</option>";
|
||||
} else {
|
||||
echo "<option value='$i'>$i</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</form>
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
echo "$minlist tot $mincount ($countresults totaal)";
|
||||
$n = min($offset + 1, $countresults);
|
||||
$m = min($offset + $entries, $countresults);
|
||||
echo " $n tot $m ($countresults totaal)";
|
||||
?>
|
||||
@@ -1,5 +1,5 @@
|
||||
<tr>
|
||||
<th><input class="table-checkbox" type="checkbox" id="checkall" name="checkall" onchange="checkAll(this)"></th>
|
||||
<th><input class="table-checkbox" type="checkbox" id="checkall" name="checkall" onchange="checkAll()"></th>
|
||||
<th class="table-username">Gebruikersnaam</th>
|
||||
<th class="table-status">Status</th>
|
||||
<th class="table-comment">Aantekening</th>
|
||||
@@ -14,7 +14,6 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
$username = $user['username'];
|
||||
$role = $user['role'];
|
||||
$bancomment = $user['bancomment'];
|
||||
$function = "checkCheckAll(document.getElementById('checkall'))";
|
||||
|
||||
echo("
|
||||
<tr>
|
||||
@@ -24,20 +23,47 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {
|
||||
class='checkbox-list'
|
||||
value='$userID'
|
||||
form='admin-batchform'
|
||||
onchange='$function'>
|
||||
onchange='checkCheckAll();'>
|
||||
</td>
|
||||
<td>$username</td>
|
||||
<td>$role</td>
|
||||
<td>$bancomment</td>
|
||||
<td>
|
||||
<div class='bancomment'>$bancomment</div>
|
||||
<div class='bancommentedit'>
|
||||
<form class='bancommentform'
|
||||
id='bancommentform'
|
||||
onsubmit='editComment(this);
|
||||
return false;'>
|
||||
<input type='text'
|
||||
name='bancommenttext'
|
||||
placeholder='Schrijf een aantekening'
|
||||
value='$bancomment'>
|
||||
<input type='hidden'
|
||||
name='bancommentuserID'
|
||||
value='$userID'>
|
||||
<button type='submit'>Update</button>
|
||||
</form>
|
||||
</div>
|
||||
<button type='button' onclick='toggleBancomment(this)'>Verander</button>
|
||||
</td>
|
||||
<td>
|
||||
<form class='admin-useraction'
|
||||
action='API/adminChangeUser.php'
|
||||
method='post'>
|
||||
<select class='action' name='actions'>
|
||||
<option value='frozen'>Bevries</option>
|
||||
<option value='banned'>Ban</option>
|
||||
<option value='user'>Activeer</option>
|
||||
</select>
|
||||
onsubmit=\"adminUpdate(this); return false;\">
|
||||
<select class='action' name='actions'>");
|
||||
if (!($userinfo == 'admin'
|
||||
AND ($user['role'] == 'admin'
|
||||
OR $user['role'] == 'owner'))) {
|
||||
echo "<option value='frozen'>Bevries</option>
|
||||
<option value='banned'>Ban</option>
|
||||
<option value='user'>Activeer</option>";
|
||||
|
||||
if ($userinfo == 'owner') {
|
||||
echo "<option value='admin'>Admin</option>
|
||||
<option value='owner'>Owner</option>";
|
||||
}
|
||||
}
|
||||
|
||||
echo ("</select>
|
||||
<input type='hidden' name='userID' value='$userID'>
|
||||
<input type='submit' value='Confirm'>
|
||||
</form>
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
<!-- function test_input taken from http://www.w3schools.com/php/php_form_validation.asp -->
|
||||
<?php
|
||||
$search = "";
|
||||
$currentpage = 1;
|
||||
$perpage = 20;
|
||||
$status = array("user", "frozen", "banned", "unconfirmed", "admin", "owner");
|
||||
$groupstatus = array("hidden", "public", "membersonly");
|
||||
$pagetype = "user";
|
||||
$userinfo = getRoleByID($_SESSION['userID']);
|
||||
|
||||
if (isset($_GET["search"])) {
|
||||
$search = test_input($_GET["search"]);
|
||||
@@ -24,13 +23,6 @@ if (isset($_GET["groupstatus"])) {
|
||||
$groupstatus = $_GET["groupstatus"];
|
||||
}
|
||||
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
if (isset($_POST["pageselect"])) {
|
||||
$currentpage = $_POST["pageselect"];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
@@ -39,7 +31,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
<div class="admin-options">
|
||||
<form class="admin-searchform"
|
||||
id="admin-searchform"
|
||||
action="javascript:adminSearch();"
|
||||
action="javascript:searchFromOne();"
|
||||
method="get">
|
||||
|
||||
<div class="admin-searchbar">
|
||||
@@ -120,23 +112,33 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
<div class="admin-users">
|
||||
<div class="admin-usertitle">
|
||||
<h4>Resultaat:</h4>
|
||||
<span style="float: right" id="admin-pageinfo">
|
||||
<div style="float: right" id="admin-pageinfo">
|
||||
|
||||
</span>
|
||||
<form
|
||||
id="admin-batchform"
|
||||
action="API/adminChangeUser.php"
|
||||
method="post">
|
||||
</div>
|
||||
<form id="admin-batchform"
|
||||
onsubmit="adminUpdate(this); return false;">
|
||||
|
||||
<input type="hidden" name="batchactions" id="batchinput">
|
||||
<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>
|
||||
<?php
|
||||
if ($userinfo == 'owner') {
|
||||
echo "<button type=\"submit\"
|
||||
name=\"batchactions\"
|
||||
id=\"admin\"
|
||||
value=\"admin\">Maak Admin</button>
|
||||
<button type=\"submit\"
|
||||
name=\"batchactions\"
|
||||
id=\"owner\"
|
||||
value=\"owner\">Maak Owner</button>";
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<form
|
||||
id="admin-groupbatchform"
|
||||
action="API/adminChangeUser.php"
|
||||
method="post">
|
||||
<form id="admin-groupbatchform"
|
||||
onsubmit="adminUpdate(this); return false;">
|
||||
|
||||
<input type="hidden" name="groupbatchactions" id="groupbatchinput">
|
||||
<button type="submit" name="batchactions" id="hide" value="hidden">Hide</button>
|
||||
<button type="submit" name="batchactions" id="ban" value="public">Public</button>
|
||||
<button type="submit" name="batchactions" id="members" value="membersonly">Members</button>
|
||||
|
||||
@@ -19,9 +19,12 @@
|
||||
|
||||
require_once ("../queries/checkInput.php");
|
||||
require_once ("../queries/connect.php");
|
||||
require_once ("../queries/user.php");
|
||||
|
||||
session_start();
|
||||
|
||||
if(!isset($_SESSION["userID"])){
|
||||
header("location:login.php");
|
||||
}
|
||||
} else {
|
||||
updateLastActivity();
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ $userinfo = getHeaderInfo();
|
||||
</div>
|
||||
<?=$userinfo["fname"]?>
|
||||
</div>
|
||||
<img id="own-profile-picture" class="profile-picture" src="<?=$userinfo["profilepicture"]?>"/>
|
||||
<i id="open-notifications" class="fa fa-bars"></i>
|
||||
<img id="own-profile-picture" class="profile-picture" src="<?=$userinfo["profilepicture"]?>"/><i id="open-notifications" class="fa fa-bars"></i>
|
||||
</div>
|
||||
</header>
|
||||
<?php include("notification-center.php"); ?>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
include_once ("../queries/user.php");
|
||||
|
||||
// auth
|
||||
$userinfo = getRoleByID($_SESSION['userID'])->fetch(PDO::FETCH_ASSOC);
|
||||
$role = getRoleByID($_SESSION['userID']);
|
||||
|
||||
if ($userinfo['role'] == 'admin' OR $userinfo['role'] == 'owner') {
|
||||
if ($role == 'admin' OR $role == 'owner') {
|
||||
echo "<a href=\"admin.php\" data-title=\"Admin\"><i class=\"fa fa-lock\"></i></a>";
|
||||
echo "<style>@import url('styles/adminbutton.css'); </style>";
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ echo("
|
||||
<div class="commentfield">
|
||||
<form id="newcommentform" onsubmit="return false;">
|
||||
<input type="hidden" id="newcomment-textarea" name="postID" value="<?= $postID ?>">
|
||||
<textarea id="newcomment" name="newcomment-content" placeholder="Laat een reactie achter..."></textarea> <br>
|
||||
<textarea id="newcomment" name="newcomment-content" placeholder="Laat een reactie achter..." maxlength="1000"></textarea><span></span> <br>
|
||||
<button onclick="postComment('reaction')" name="button" value="reaction">Reageer!</button>
|
||||
<button onclick="postComment('nietslecht')" name="button" value="nietslecht" class="nietslecht">
|
||||
<?php
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="content">
|
||||
<div class="user-box">
|
||||
<img class="profile-picture main-picture" src="<?= $user["profilepicture"] ?>"><br />
|
||||
<img class="profile-picture main-picture <?= $user["onlinestatus"] ?>" src="<?= $user["profilepicture"] ?>"><br />
|
||||
<div class="platform">
|
||||
<div class="status-buttons-container">
|
||||
<button disabled class="gray">
|
||||
<?= $user["onlinestatus"] ?>
|
||||
<?= $user["onlinestatus"] ?>
|
||||
</button>
|
||||
<button disabled class="gray"><?= $user["role"] ?></button>
|
||||
</div>
|
||||
@@ -29,7 +29,7 @@
|
||||
<h3>Informatie</h3>
|
||||
<p>
|
||||
<ul>
|
||||
<li>Geboren op: <?= $user["birthdate"] ?></li>
|
||||
<li>Leeftijd: <?= getAge($user["birthdate"]) ?> jaar</li>
|
||||
<li>Locatie: <?= $user["location"] ?></li>
|
||||
<li>Lid sinds: <?= nicetime($user["creationdate"]) ?></li>
|
||||
</ul>
|
||||
|
||||
@@ -21,10 +21,8 @@ if (isset($_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">
|
||||
@@ -40,8 +38,10 @@ $group_count = countSomeGroups($search)->fetchColumn();
|
||||
id="search-input"
|
||||
name="search"
|
||||
onkeyup="
|
||||
searchUsers(<?= $user_n ?>, <?= $user_perpage ?>);
|
||||
searchGroups(<?= $group_n ?>, <?= $group_perpage ?>);"
|
||||
$('#user-pagenumber, #group-pagenumber').prop('value', 1);
|
||||
searchUsers();
|
||||
searchGroups();
|
||||
pageNumber();"
|
||||
placeholder="Zoek"
|
||||
value=<?php echo "$search";?>
|
||||
>
|
||||
@@ -66,26 +66,12 @@ $group_count = countSomeGroups($search)->fetchColumn();
|
||||
<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>
|
||||
<div id="user-pageselect"></div>
|
||||
|
||||
<ul id='search-users-list' class='nav-list'>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
searchUsers(<?= $user_n ?>, <?= $user_perpage ?>);
|
||||
searchUsers();
|
||||
});
|
||||
</script>
|
||||
</ul>
|
||||
@@ -94,26 +80,12 @@ $group_count = countSomeGroups($search)->fetchColumn();
|
||||
<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>
|
||||
<div id="group-pageselect"></div>
|
||||
|
||||
<ul id="search-groups-list" class="nav-list">
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
searchGroups(<?= $group_n ?>, <?= $group_perpage ?>);
|
||||
searchGroups();
|
||||
});
|
||||
</script>
|
||||
</ul>
|
||||
|
||||
36
website/views/searchPageNumber.php
Normal file
36
website/views/searchPageNumber.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
if ($option == "user") {
|
||||
echo "<select class=\"user-pageselect\"
|
||||
name=\"user-pageselect\"
|
||||
id='user-pagenumber'
|
||||
form=\"search-form\"
|
||||
onchange=\"pageNumber(); searchUsers();\">";
|
||||
|
||||
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>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</select>";
|
||||
} else {
|
||||
echo "<select class=\"group-pageselect\"
|
||||
name=\"group-pageselect\"
|
||||
id='group-pagenumber'
|
||||
form=\"search-form\"
|
||||
onchange=\"pageNumber(); searchGroups();\">";
|
||||
|
||||
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>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</select>";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -75,6 +75,9 @@ $settings = getSettings();
|
||||
<?=$year?>
|
||||
</option>
|
||||
<?php endfor; ?>
|
||||
<option value="680" <?=(680 == $currentbday->format("Y")) ? "selected" : ""?>>
|
||||
680
|
||||
</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
@@ -99,7 +102,8 @@ $settings = getSettings();
|
||||
rows="5"
|
||||
title="bio"
|
||||
id="bio"
|
||||
><?=$settings["bio"]?></textarea>
|
||||
maxlength="1000"
|
||||
><?=$settings["bio"]?></textarea><span></span>
|
||||
</li>
|
||||
<li>
|
||||
<label></label>
|
||||
|
||||
Reference in New Issue
Block a user