-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadmin.js
More file actions
115 lines (106 loc) · 2.69 KB
/
admin.js
File metadata and controls
115 lines (106 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
function SearchLan() {
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("searchForLan");
filter = input.value.toUpperCase();
table = document.getElementById("users-table");
tr = table.getElementsByTagName("tr");
for(i=0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[1];
if(td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
}
}
function SearchName() {
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("searchForName");
filter = input.value.toUpperCase();
table = document.getElementById("assign-table");
console.log(table);
tr = table.getElementsByTagName("tr");
for(i=0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if(td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
}
}
function SearchLanReg() {
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("searchForLanReg");
filter = input.value.toUpperCase();
table = document.getElementById("users-tableReg");
tr = table.getElementsByTagName("tr");
for(i=0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[1];
if(td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
}
}
function remove(email) {
if(confirm("Are you sure you want to delete " + email + "?")){
$.ajax({
data: "Email=" + email,
url: "API/RemoveConsultant.php",
type: "POST",
success: function(){
location.reload(true);
}
});
}
}
function remove_assignment(conId, projId) {
if(confirm("Are you sure you want to remove this assignment?")){
$.ajax({
data: `conId=${conId}&projId=${projId}`,
url: "API/RemoveAssignment.php",
type: "POST",
success: function(data){
location.reload(true);
}
});
}
}
function cleanConsultant(email, consultantId) {
if(confirm("Are you sure you want to remove all data for this consultant: " + email + "?")){
$.ajax({
data: "id=" + consultantId,
url: "API/CleanConsultant.php",
type: "POST",
success: function(){
location.reload(true);
}
});
}
}
function removeRegistration(projectId) {
if(confirm("Are you sure you want to remove all data for this phone registration?")){
$.ajax({
data: "id=" + projectId,
url: "API/RemoveRegistration.php",
type: "POST",
success: function(){
location.reload(true);
}
});
}
}