-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgetCase.js
More file actions
86 lines (71 loc) · 2.67 KB
/
getCase.js
File metadata and controls
86 lines (71 loc) · 2.67 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
function viewProfile() {
var cid=document.getElementById("searchCid").value;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myObj = JSON.parse(this.responseText);
success = myObj.success;
cid = myObj.cid;
oDate = myObj.oDate;
des = myObj.description;
caseProcess = myObj.caseProcess;
ineStDate = myObj.ineStDate;
suspect = myObj.suspect;
officer = myObj.officer;
//document.getElementById("cid").checked=true;
document.getElementById("cid").value = cid;
document.getElementById("oDate").value = oDate;
//document.getElementById('profileImg').src = "php/uploads/profile/" + uniId + '.jpg'
document.getElementById("des").innerHTML = des;
document.getElementById("caseProcess").innerHTML = caseProcess;
document.getElementById("ineStDate").value = ineStDate;
document.getElementById("suspects").innerHTML = suspect;
document.getElementById("officers").innerHTML = officer;
//alert("sefs");
}
};
xmlhttp.open("GET", "php/getCase.php?cid="+cid, true);
xmlhttp.send();
}
function postSuspect(){
var cid=document.getElementById("cid").value;
$.post("php/addSuspect.php",
{
cid: cid,
suspect: document.getElementById("suspect").value
},
function(data,status){
alert("Done")
if (data==1) alert("Done");
else alert("Error");
document.getElementById('id01').style.display='none'
});
}
function postOfficer(){
var cid=document.getElementById("cid").value;
$.post("php/addOfficer.php",
{
cid: cid,
officer: document.getElementById("officer").value
},
function(data,status){
//alert(data);
if (data==1) alert("Done");
else alert("Error");
document.getElementById('id02').style.display='none'
});
}
function deleteCase(){
alert("data");
var cid=document.getElementById("cid").value;
$.post("php/deleteCase.php",
{
cid: cid
},
function(data,status){
alert(data);
//if (data==1) alert("Done");
//else alert("Error");
//document.getElementById('id02').style.display='none'
});
}