-
Notifications
You must be signed in to change notification settings - Fork 3
/
log.php
93 lines (76 loc) · 2.97 KB
/
log.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
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
<?php
include_once("navigation.php");
?>
<center><h2>VIEW LOG HISTORY</h2></center>
<center><form action="" class="form-horizontal" method="post" name="myForm" id="formlog">
<br>
<div class="col-4">
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="searchname" name="searchname" placeholder="ComponentID/CPU-ID">
</div>
<div class="col-md-3">
<input type="text" class="form-control" id="actio" name="actio" placeholder="Purpose">
</div>
<label for="inputEmail3" class="col-md-1 control-label">From</label>
<div class="col-md-2">
<input type="date" class="form-control" id="from" name="from" placeholder="From Date" required>
</div>
<label for="inputEmail3" class="col-md-1 control-label">To</label>
<div class="col-md-2">
<input type="date" class="form-control" id="to" name="to" placeholder="To Date" required>
</div>
<button type="submit" class="btn btn-primary" id="searchareabtn" name="goo">Search </button>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div class="loader" id="load"></div>
<div class="form-group" id="reportarea">
</div>
</form></center><br><br><br>
<?php
include_once("footer.php");
?>
<script>
const form= document.querySelector("#formlog");
let xhr=new XMLHttpRequest();
xhr.open("POST","php/log.php",true);
xhr.onload=()=>{
if(xhr.readyState==XMLHttpRequest.DONE){
if(xhr.status===200)
{
document.getElementById("load").style.display="none";
let data=xhr.response;
console.log(data);
document.getElementById("reportarea").innerHTML=data;
document.getElementById("reportarea").style.display="block";
}
}
}
let formData = new FormData(form);
xhr.send(formData);
document.getElementById("searchareabtn").onclick=(e)=>
{
e.preventDefault();
let xhr = new XMLHttpRequest();
xhr.open("POST", "php/searchlog.php", true);
xhr.onload = ()=>{
if(xhr.readyState === XMLHttpRequest.DONE){
if(xhr.status===200)
{
let data=xhr.response;
console.log(data);
document.getElementById("reportarea").innerHTML=data;
}
}
}
let formData = new FormData(form);
xhr.send(formData);
}
</script>
</body>
</html>