fixed form with get, fix accompanying css

This commit is contained in:
Hendrik
2017-01-19 11:08:45 +01:00
parent 38e5b28ff5
commit c4d78e54bc
2 changed files with 23 additions and 27 deletions

View File

@@ -22,6 +22,10 @@
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
} }
.admin-searchform {
display: inline-block;
}
.admin-searchbar { .admin-searchbar {
display: inline-block; display: inline-block;
margin: 10px; margin: 10px;
@@ -44,10 +48,6 @@
width: 120px; width: 120px;
} }
.admin-groupfilter {
display: none;
}
.admin-users { .admin-users {
margin: 10px; margin: 10px;
} }

View File

@@ -43,23 +43,24 @@ $listnr = 0; // TODO: add page functionality
$status = $groupstatus = array(); $status = $groupstatus = array();
$pagetype = "user"; $pagetype = "user";
if (!empty($_GET["search"])) {
$search = test_input($_GET["search"]);
}
if (!empty($_GET["pagetype"])) {
$pagetype = test_input($_GET["pagetype"]);
}
if (!empty($_GET["status"])) {
$status = $_GET["status"];
}
if (!empty($_GET["groupstatus"])) {
$groupstatus = $_GET["groupstatus"];
}
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($_POST["search"])) {
$search = test_input($_POST["search"]);
}
if (!empty($_POST["pagetype"])) {
$pagetype = test_input($_POST["pagetype"]);
}
if (!empty($_POST["status"])) {
$status = $_POST["status"];
}
if (!empty($_POST["groupstatus"])) {
$groupstatus = $_POST["groupstatus"];
}
if (!empty($_POST["actions"]) && !empty($_POST["userID"])) { if (!empty($_POST["actions"]) && !empty($_POST["userID"])) {
changeUserStatusByID($db, $_POST["userID"], $_POST["actions"]); changeUserStatusByID($db, $_POST["userID"], $_POST["actions"]);
} elseif (!empty($_POST["actions"]) && !empty($_POST["groupID"])) { } elseif (!empty($_POST["actions"]) && !empty($_POST["groupID"])) {
@@ -81,13 +82,10 @@ function test_input($data) {
<div class="admin-title"> <div class="admin-title">
<h1>User Management Panel</h1> <h1>User Management Panel</h1>
</div> <br> </div> <br>
<form class="admin-actionform"
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
method="post">
<div class="admin-options"> <div class="admin-options">
<form class="admin-searchform" <form class="admin-searchform"
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
method="post"> method="get">
<div class="admin-searchbar"> <div class="admin-searchbar">
<h2>Search</h2> <h2>Search</h2>
<input type="text" <input type="text"
@@ -190,7 +188,7 @@ function test_input($data) {
$username = $user['username']; $username = $user['username'];
$role = $user['role']; $role = $user['role'];
$bancomment = $user['bancomment']; $bancomment = $user['bancomment'];
$thispage = htmlspecialchars($_SERVER['PHP_SELF']); $thispage = htmlspecialchars(basename($_SERVER['REQUEST_URI']));
echo(" echo("
<tr> <tr>
@@ -256,9 +254,7 @@ function test_input($data) {
?> ?>
</table> </table>
</div> </div>
</form>
<pre> <pre>
<?php print_r($_POST); ?>
</pre> </pre>
</div> </div>
</div> </div>