move js to /js

This commit is contained in:
Hendrik
2017-01-20 13:14:28 +01:00
parent 0f02859124
commit 6418b2b679
2 changed files with 46 additions and 48 deletions

View File

@@ -0,0 +1,44 @@
window.onload = function() {
changeFilter();
};
function checkAll(allbox) {
var checkboxes = document.getElementsByClassName('checkbox-list');
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = allbox.checked;
}
}
}
function checkCheckAll(allbox) {
var checkboxes = document.getElementsByClassName('checkbox-list');
var checked = true;
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
if (checkboxes[i].checked == false) {
checked = false;
break;
}
}
}
allbox.checked = checked;
}
function changeFilter() {
if (document.getElementById('group').checked) {
document.getElementById('admin-filter').style.display = 'none';
document.getElementById('admin-groupfilter').style.display = 'inline-block';
document.getElementById('admin-batchactions').style.display = 'none';
document.getElementById('admin-groupbatchactions').style.display = 'inline-block';
} else {
document.getElementById('admin-filter').style.display = 'inline-block';
document.getElementById('admin-groupfilter').style.display = 'none';
document.getElementById('admin-batchactions').style.display = 'inline-block';
document.getElementById('admin-groupbatchactions').style.display = 'none';
}
}

View File

@@ -3,53 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Admin Panel</title> <title>Admin Panel</title>
<script type="text/javascript"> <script src="../public/js/admin.js" charset="utf-8"></script>
window.onload = function() {
changeFilter();
};
function checkAll(allbox) {
var checkboxes = document.getElementsByClassName('checkbox-list');
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = allbox.checked;
}
}
}
function checkCheckAll(allbox) {
var checkboxes = document.getElementsByClassName('checkbox-list');
var checked = true;
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].type == 'checkbox') {
if (checkboxes[i].checked == false) {
checked = false;
break;
}
}
}
allbox.checked = checked;
}
function changeFilter() {
if (document.getElementById('group').checked) {
document.getElementById('admin-filter').style.display = 'none';
document.getElementById('admin-groupfilter').style.display = 'inline-block';
document.getElementById('admin-batchactions').style.display = 'none';
document.getElementById('admin-groupbatchactions').style.display = 'inline-block';
} else {
document.getElementById('admin-filter').style.display = 'inline-block';
document.getElementById('admin-groupfilter').style.display = 'none';
document.getElementById('admin-batchactions').style.display = 'inline-block';
document.getElementById('admin-groupbatchactions').style.display = 'none';
}
}
</script>
<?php <?php
include_once("../queries/user.php"); include_once("../queries/user.php");
include_once("../queries/group_page.php"); include_once("../queries/group_page.php");
@@ -228,7 +182,7 @@ function test_input($data) {
if ($pagetype == "user") { if ($pagetype == "user") {
$pages = countSomeUsersByStatus($search, $status); $pages = countSomeUsersByStatus($search, $status);
} else { } else {
$pages = countSomeGroupsByStatus($search, $status); $pages = countSomeGroupsByStatus($search, $groupstatus);
} }
$countresults = $pages->fetchColumn(); $countresults = $pages->fetchColumn();
$mincount = min($listm, $countresults); $mincount = min($listm, $countresults);