-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
59 lines (56 loc) · 1.8 KB
/
home.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
<?php include 'welcome.php' ?>
<script>
$('#manage-records').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_track',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
resp=JSON.parse(resp)
if(resp.status==1){
alert_toast("Data successfully saved",'success')
setTimeout(function(){
location.reload()
},800)
}
}
})
})
$('#tracking_id').on('keypress',function(e){
if(e.which == 13){
get_person()
}
})
$('#check').on('click',function(e){
get_person()
})
function get_person(){
start_load()
$.ajax({
url:'ajax.php?action=get_pdetails',
method:"POST",
data:{tracking_id : $('#tracking_id').val()},
success:function(resp){
if(resp){
resp = JSON.parse(resp)
if(resp.status == 1){
$('#name').html(resp.name)
$('#address').html(resp.address)
$('[name="person_id"]').val(resp.id)
$('#details').show()
end_load()
}else if(resp.status == 2){
alert_toast("Unknow tracking id.",'danger');
end_load();
}
}
}
})
}
</script>