03.
<head>
04.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
05.
<title>Untitled Document</title>
06.
<link rel=
"stylesheet"
href=
"bootstrap/css/bootstrap.min.css"
>
07.
<link rel=
"stylesheet"
href=
"bootstrap/css/bootstrap-theme.min.css"
>
08.
<style>
09.
a:link{
10.
color: inherit;
11.
}
12.
13.
input[type=number]::-webkit-inner-spin-button,
14.
input[type=number]::-webkit-outer-spin-button {
15.
-webkit-appearance: none;
16.
margin: 0;
17.
}
18.
</style>
19.
<script type=
"text/javascript"
>
20.
function
fncMath()
21.
{
22.
document.getElementById(
"jcash_1"
).innerHTML =parseInt(document.cash.cash_1.value)*1000;
23.
document.getElementById(
"jcash_2"
).innerHTML =parseInt(document.cash.cash_2.value)*500;
24.
document.getElementById(
"jcash_3"
).innerHTML =parseInt(document.cash.cash_3.value)*100;
25.
document.getElementById(
"jcash_4"
).innerHTML =parseInt(document.cash.cash_4.value)*50;
26.
document.getElementById(
"jcash_5"
).innerHTML =parseInt(document.cash.cash_5.value)*20;
27.
document.getElementById(
"jcash_6"
).innerHTML =parseInt(document.cash.cash_6.value)*10;
28.
document.getElementById(
"jcash_7"
).innerHTML =parseInt(document.cash.cash_7.value)*5;
29.
document.getElementById(
"jcash_8"
).innerHTML =parseInt(document.cash.cash_8.value)*2;
30.
document.getElementById(
"jcash_9"
).innerHTML =parseInt(document.cash.cash_9.value)*1;
31.
document.getElementById(
"jcash_sum"
).innerHTML =
32.
((parseInt(document.cash.cash_1.value)*1000)+(parseInt(document.cash.cash_6.value)*10)+
33.
(parseInt(document.cash.cash_2.value)*500)+(parseInt(document.cash.cash_7.value)*5)+
34.
(parseInt(document.cash.cash_3.value)*100)+(parseInt(document.cash.cash_8.value)*2)+
35.
(parseInt(document.cash.cash_4.value)*50)+(parseInt(document.cash.cash_9.value)*1)+
36.
(parseInt(document.cash.cash_5.value)*20));
37.
38.
}
39.
</script>
40.
</head>
41.
<body style=
"background-color:#f4f4f4"
onload=
"fncMath();"
>
42.
<form name=
"cash"
id=
"cash"
method=
"post"
action=
"cash_open.php"
>
43.
44.
45.
<table
class
=
"table"
width=
"100%"
>
46.
<thead>
47.
<tr
class
=
" btn-success"
>
48.
<th colspan=
"7"
>นับเงิน</th>
49.
</tr>
50.
</thead>
51.
<tbody style=
"font-size:smaller;"
>
52.
<?PHP
53.
54.
$i_cash
=1;
55.
$cash_name
=
array
(
"array0"
,
"ธนบัตร 1,000 บาท"
,
"ธนบัตร 500 บาท"
,
"ธนบัตร 100 บาท"
,
"ธนบัตร 50 บาท"
,
"ธนบัตร 20 บาท"
,
"เหรียญ 10 บาท"
,
"เหรียญ 5 บาท"
,
"เหรียญ 2 บาท"
,
"เหรียญ 1 บาท"
);
56.
while
(
$i_cash
<=9) {
57.
?>
58.
<tr>
59.
<th style=
"text-align:left; width:30%"
><?=
$cash_name
[
$i_cash
]?></th>
60.
<th style=
"text-align:left"
>จำนวน</th>
61.
<th style=
"text-align:right"
><input type=
"number"
required autocomplete=
"off"
onkeyup=
"fncMath();"
name=
"cash_<?=$i_cash?>"
id=
"cash_<?=$i_cash?>"
style=
"text-align:right; width:50%"
value=
"0"
/></th>
62.
<th style=
"text-align:left; color:#999999"
>=</th>
63.
<th style=
"text-align:right; color:#999999; width:20%"
><span id=
"jcash_<?=$i_cash?>"
></span></th>
64.
<th style=
"text-align:right; color:#999999"
>THB</th>
65.
</tr>
66.
<?
$i_cash
++; } ?>
67.
<tr
class
=
"well"
>
68.
<th colspan=
"2"
style=
"text-align:right; color:#666666"
><a href=
"transfer_smart.php"
><div
class
=
"btn btn-primary btn-sm glyphicon glyphicon-arrow-left"
style=
"width:100%; text-align:left"
> กลับ</div></a></th>
69.
<th style=
"text-align:right; color:#666666"
>รวม</th>
70.
<th style=
"text-align:left; color:#666666"
>=</th>
71.
<th style=
"text-align:right; color:#666666"
><span id=
"jcash_sum"
></span></th>
72.
<th style=
"text-align:right; color:#666666"
>THB
73.
</th>
74.
</tr>
75.
</tbody>
76.
</table>
77.
78.
</body>
79.
</html>