move js to /js
This commit is contained in:
44
website/public/js/admin.js
Normal file
44
website/public/js/admin.js
Normal 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';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user