fixed pageselector in admin
This commit is contained in:
@@ -6,12 +6,18 @@ require_once ("../../queries/checkInput.php");
|
||||
require_once ("../../queries/user.php");
|
||||
require_once ("../../queries/group_page.php");
|
||||
|
||||
$userinfo = getRoleByID($_SESSION['userID'])->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (isset($_POST["actions"]) && isset($_POST["userID"])) {
|
||||
changeUserStatusByID($_POST["userID"], $_POST["actions"]);
|
||||
} else if (isset($_POST["actions"]) && isset($_POST["groupID"])) {
|
||||
changeGroupStatusByID($_POST["groupID"], $_POST["actions"]);
|
||||
} else if (isset($_POST["batchactions"]) && isset($_POST["checkbox-user"])) {
|
||||
changeMultipleUserStatusByID($_POST["checkbox-user"], $_POST["batchactions"]);
|
||||
if ($userinfo['role'] == 'owner') {
|
||||
changeMultipleUserStatusByID($_POST["checkbox-user"], $_POST["batchactions"]);
|
||||
} else {
|
||||
changeMultipleUserStatusByIDAdmin($_POST["checkbox-user"], $_POST["batchactions"]);
|
||||
}
|
||||
} else if (isset($_POST["groupbatchactions"]) && isset($_POST["checkbox-group"])) {
|
||||
changeMultipleGroupStatusByID($_POST["checkbox-group"], $_POST["groupbatchactions"]);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ session_start();
|
||||
require_once ("../../queries/connect.php");
|
||||
require_once ("../../queries/checkInput.php");
|
||||
require_once ("../../queries/user.php");
|
||||
require_once ("../../queries/group_page.php");
|
||||
|
||||
$search = "";
|
||||
if (isset($_POST["search"])) {
|
||||
@@ -21,8 +22,17 @@ if (isset($_POST['status'])) {
|
||||
$status = $_POST["status"];
|
||||
}
|
||||
|
||||
if ($pagetype == "user") {
|
||||
include ("../../views/adminpanel-page.php");
|
||||
} else {
|
||||
echo "Pagenumber failed!";
|
||||
$groupstatus = array();
|
||||
if (isset($_POST['groupstatus'])) {
|
||||
$groupstatus = $_POST["groupstatus"];
|
||||
}
|
||||
|
||||
$entries = 20;
|
||||
$currentpage = 1;
|
||||
if (isset($_POST['currentpage'])) {
|
||||
$currentpage = (int) test_input($_POST["currentpage"]);
|
||||
}
|
||||
|
||||
$offset = (int) $currentpage * $entries - $entries;
|
||||
|
||||
include ("../../views/adminpanel-page.php");
|
||||
|
||||
@@ -8,13 +8,11 @@ require_once ("../../queries/user.php");
|
||||
require_once ("../../queries/group_page.php");
|
||||
|
||||
$offset = 0;
|
||||
if (isset($_POST["n"])) {
|
||||
$offset = (int) test_input($_POST["n"]);
|
||||
}
|
||||
$entries = 20;
|
||||
if (isset($_POST["m"])) {
|
||||
$entries = (int) test_input($_POST["m"]);
|
||||
if (isset($_POST["currentpage"])) {
|
||||
$offset = (int) test_input($_POST["currentpage"]) * $entries - $entries;
|
||||
}
|
||||
|
||||
$search = "";
|
||||
if (isset($_POST["search"])) {
|
||||
$search = test_input($_POST["search"]);
|
||||
|
||||
Reference in New Issue
Block a user