-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathecTerminal.phtml
87 lines (72 loc) · 2.28 KB
/
ecTerminal.phtml
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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<?php
require_once __DIR__.'/inc/stdLib.php';
$menu = $_SESSION['menu'];
echo $menu['stylesheets'];
echo $menu['javascripts'];
echo $head['JQTABLE'];
echo $head['THEME'];
echo $head['T8'];
?>
<script>
$( document ).ready( function(){
$.ajax({
url: 'ajax/ecTerminalData.php',
type: "POST",
data: { 'action': 'getTerminalCustomerData' },
success: function( res ){
var ip = res['ec_terminal_ip-adress'];
var port = res['ec_terminal_port'];
var passwd = res['ec_terminal_passwd'];
$( '#end_of_day' ).button({
label: kivi.t8( 'End of day' )
}).css({
'margin':'5px'
}).click( function(){
$.ajax({
url: 'ajax/ecTerminal.py',
type: "POST",
timeout: 100,
data: { 'action':'end_of_day', 'ip': ip,'port': port, 'passwd': passwd }
});
});
$( '#payment' ).button({
label: kivi.t8( 'Pay' )
}).css({
'margin':'5px'
}).click( function(){
$.ajax({
url: 'ajax/ecTerminal.py',
type: "post",
timeout: 100,
data: { 'action':'pay', 'ip': ip,'port': port, 'passwd': passwd, 'amount': $( '#amount' ).val(), 'name': '' }
});
});
},
error: function(){
alert( 'Error: getTerminalData() ');
}
})
$( '#amount' ).focus().keyup( function(e){
if( /\D/g.test( this.value ) ) this.value = this.value.replace( /\D/g, '' ); //digits only
});
$( '#headline' ).html( 'EC Terminal' ).css( 'font-weight', 'bold' );
$( '#amountlable' ).html( kivi.t8( 'Amount without comma') +': ' ).css( 'font-weight', 'bold' );
});
</script>
</head>
<body>
<?php
echo $menu['pre_content'];
echo $menu['start_content'];
?>
<p id="headline" class="ui-state-highlight ui-corner-all tools" style="margin-top: 20px; padding: 0.6em;"></p>
<table style="margin-left:10px;">
<tr><td id="amountlable"></td></td><td><input type="text" size="7" id="amount"></input></td><td><button id="payment"></button></td></tr>
<tr><td><button id="end_of_day"></button></td><td></td><td></td></tr>
</table>
<?php echo $menu['end_content']; ?>
</html>