-
Notifications
You must be signed in to change notification settings - Fork 0
/
myscript.js
67 lines (59 loc) · 1.42 KB
/
myscript.js
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
$(document).ready(function(){
var url = '../php/myphp.php';
//for ticket operator
$('.ticket').click(function(e){
var id = $(e.target).val();
$.ajax({
url: url,
type: 'POST',
data: { id: id,
action: 'update'
},
success: function (data){
data = JSON.parse(data);
$('#num-panel').html(data.name + ' - ' + data.tail);
}
});
});
//for personnel
var personnel = {
reset: function(){
$.ajax({
url: url,
type: 'POST',
data: { action: 'reset' },
success: function(){
window.location.replace('');
}
});
},
serving: function(id){
$.ajax({
url: url,
type: 'POST',
data: { id: id, action: 'serving' },
success: function(data){
data = JSON.parse(data);
$('#panel').html(data.name + ' - ' + data.current)
}
});
}
}
$('.kurso').click(function(e){
var song = new Audio();
song.src = "paging.mp3";
song.play();
var id = $(e.target).val();
$('#next').attr('value',id); //assign id to the next button for reference for the upcoming next clicks
$('#next').prop('disabled',false);
personnel.serving(id);
});
$('#next').click(function(e){
var song = new Audio();
song.src = "paging.mp3";
song.play();
var id = $(e.target).val();
personnel.serving(id);
});
$('#reset').click(function(e){ personnel.reset(); });
});