forked from v4l3n71n/covas-bo
add select
This commit is contained in:
parent
f740138cbc
commit
8405947254
@ -6,8 +6,8 @@ param["nbPages"] = 20;
|
|||||||
|
|
||||||
instance.get("users/count", { withCredentials: true }).then(function(response){
|
instance.get("users/count", { withCredentials: true }).then(function(response){
|
||||||
|
|
||||||
var count = response.data / nbPages;
|
var count = response.data / param["nbPages"];
|
||||||
var reste = response.data % nbPages;
|
var reste = response.data % param["nbPages"];
|
||||||
var total = 0;
|
var total = 0;
|
||||||
if(reste != 0){
|
if(reste != 0){
|
||||||
total = Number.parseInt(count) + 1;
|
total = Number.parseInt(count) + 1;
|
||||||
@ -122,22 +122,57 @@ document.getElementById("inputStatus").addEventListener("change", function(e){
|
|||||||
var search = document.getElementById("searchUser").value;
|
var search = document.getElementById("searchUser").value;
|
||||||
var select = document.getElementById("inputRoles");
|
var select = document.getElementById("inputRoles");
|
||||||
var roles = select.options[select.selectedIndex].value;
|
var roles = select.options[select.selectedIndex].value;
|
||||||
if(search.length > 0){
|
var param = "";
|
||||||
location.href="/html/users.html?search="+search+"&status="+e.target.value+"&roles="+roles;
|
var page = getQuery("page");
|
||||||
} else {
|
if(page.length > 0){
|
||||||
location.href="/html/users.html?status="+e.target.value+"&roles="+roles;
|
param = param + "page="+page+"&";
|
||||||
}
|
}
|
||||||
|
var nbPages = getQuery("nbPages");
|
||||||
|
if(nbPages.length > 0 ){
|
||||||
|
param = param+ "nbPages="+nbPages+"&";
|
||||||
|
}
|
||||||
|
if(search.length > 0){
|
||||||
|
param = param + "search="+search+"&";
|
||||||
|
}
|
||||||
|
var status = e.target.value;
|
||||||
|
if(status != "-2"){
|
||||||
|
param = param + "status="+status+"&";
|
||||||
|
}
|
||||||
|
if(roles != "All"){
|
||||||
|
param = param + "roles="+roles;
|
||||||
|
}
|
||||||
|
|
||||||
|
location.href="/html/users.html?"+param;
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById("inputRoles").addEventListener("change", function(e){
|
document.getElementById("inputRoles").addEventListener("change", function(e){
|
||||||
var search = document.getElementById("searchUser").value;
|
var search = document.getElementById("searchUser").value;
|
||||||
var select = document.getElementById("inputStatus");
|
var select = document.getElementById("inputStatus");
|
||||||
var status = select.options[select.selectedIndex].value;
|
var status = select.options[select.selectedIndex].value;
|
||||||
if(search.length > 0){
|
var param = "";
|
||||||
location.href="/html/users.html?search="+search+"&roles="+e.target.value+"&status="+status;
|
var page = getQuery("page");
|
||||||
} else {
|
if(page.length > 0){
|
||||||
location.href="/html/users.html?roles="+e.target.value+"&status="+status;
|
param = param + "page="+page+"&";
|
||||||
}
|
}
|
||||||
|
var nbPages = getQuery("nbPages");
|
||||||
|
if(nbPages.length > 0 ){
|
||||||
|
param = param + "nbPages="+nbPages+"&";
|
||||||
|
}
|
||||||
|
if(search.length > 0){
|
||||||
|
param = param + "search="+search+"&";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(status != "-2"){
|
||||||
|
param = param + "status="+status+"&";
|
||||||
|
}
|
||||||
|
var roles = e.target.value;
|
||||||
|
if(roles != "All"){
|
||||||
|
param = param + "roles="+roles;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(param);
|
||||||
|
|
||||||
|
location.href="/html/users.html?"+param;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user