-
Notifications
You must be signed in to change notification settings - Fork 1
/
student.php
64 lines (56 loc) · 1.67 KB
/
student.php
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
<?php include("./includes/nav.php");
?>
<div class="side-bar ui bg-dark white">
<?php include("./includes/sideBar.php");?>
</div>
<div class="side-bar ui bg-dark white">
<!-- include the sideBar -->
<?php include("./includes/sideBar.php"); ?>
</div>
<div class="ui main">
<!-- add dashboard ui -->
<?php include("./includes/student_Add.php");?>
<!-- and dashboard -->
</div>
<?php include("./footer.php");?>
<script>
const search = document.querySelector('#searchTextStudent')
search.onkeyup = () => {
let txt = search.value
let text = txt.trim()
if (text !== '') {
results.innerHTML = ''
let xhr = new XMLHttpRequest()
xhr.onload = () => {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
let data = xhr.response
// console.log("Data >> " + data) for testing
results.innerHTML = data
}
}
}
xhr.open("POST", "././configuration/action3.php", true)
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
xhr.send("search=" + text)
} else {
Fetch()
}
}
Fetch()
const results = document.querySelector('#results')
function Fetch() {
let xhr = new XMLHttpRequest()
xhr.onload = () => {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
let data = xhr.response
// console.log("Data >> " + data) for testing
results.innerHTML = data
}
}
}
xhr.open("POST", "./configuration/action2.php", true)
xhr.send()
}
</script>