001.
<!DOCTYPE html>
002.
003.
<html>
004.
<head>
005.
<meta charset=
"UTF-8"
>
006.
<title></title>
008.
</head>
009.
<body>
010.
011.
012.
<nav
class
=
"navbar navbar-light bg-light shadow-sm"
>
013.
<h5
class
=
"navbar-brand"
>
014.
<img src=
"image/1.jpg"
width=
"80"
height=
"60"
alt=
""
loading=
"lazy"
>
015.
System Of Air WayBill
016.
</h5>
017.
</nav>
018.
019.
<form
class
=
"container"
method=
"GET"
action=
""
>
020.
021.
<div
class
=
"form-row"
style=
"margin-top: 50px;"
>
022.
023.
<div
class
=
"col-4 form-group"
>
024.
<label
for
=
"piecesRcp"
>No. of Pieces RCP</label>
025.
<input
class
=
"form-control"
id=
"piecesRcp"
name=
"piecesRcp"
>
026.
</div>
027.
028.
<div
class
=
"col-4 form-group"
>
029.
<label
for
=
"width"
>width</label>
030.
<input
class
=
"form-control"
id=
"width"
name=
"width"
>
031.
</div>
032.
033.
<div
class
=
"col-4 form-group"
>
034.
<label
for
=
"length"
>length</label>
035.
<input
class
=
"form-control"
id=
"length"
name=
"length"
>
036.
</div>
037.
038.
<div
class
=
"col-4 form-group"
>
039.
<label
for
=
"high"
>high</label>
040.
<input
class
=
"form-control"
id=
"high"
name=
"high"
>
041.
</div>
042.
043.
<div
class
=
"col-4 form-group"
>
044.
<label
for
=
"pcs"
>pcs</label>
045.
<input
class
=
"form-control"
id=
"pcs"
name=
"pcs"
>
046.
</div>
047.
048.
<div
class
=
"col-4 form-group"
>
049.
<label
for
=
"quantity"
>quantity</label>
050.
<input
class
=
"form-control"
id=
"quantity"
name=
"quantity"
>
051.
</div>
052.
</div>
053.
054.
<div
class
=
"form-group"
>
055.
056.
<button type=
"submit"
class
=
"btn btn-danger col-3"
><a href=
"AirWayBillForm2.php"
style=
"color: white;"
>Enter</a></button>
057.
</div>
058.
059.
</form>
060.
<br/>
061.
<?php
062.
include
'DB_ConPro9.php'
;
063.
064.
if
(
empty
(
$_GET
[
"piecesRcp"
])){
065.
066.
exit
();
067.
}
else
{
068.
$piecesRcp
=
$_GET
[
"piecesRcp"
];
069.
}
070.
071.
$width
=
$_GET
[
"width"
];
072.
$length
=
$_GET
[
"length"
];
073.
$high
=
$_GET
[
"high"
];
074.
$pcs
=
$_GET
[
"pcs"
];
075.
$quantity
=
$_GET
[
"quantity"
];
076.
077.
$ShowwlhCalculate
=
"($width*$length*$high)/6000"
;
078.
$showresult
= (
$width
*
$length
*
$high
)/6000;
079.
$showPcs
=
$pcs
;
080.
$showQuantity
=
$quantity
;
081.
$showTotalWeight
=
$showresult
*
$showPcs
;
082.
083.
?>
084.
085.
<table
class
=
"table table-striped container"
id=
"myTbl"
>
086.
<tr>
087.
<th>showCalculate</th>
088.
<th>result</th>
089.
<th>showPcs</th>
090.
<th>showQuantity</th>
091.
<th>showTotalWeight</th>
092.
<th>Add
delete
</th>
093.
</tr>
094.
<tr id=
"firstTr"
>
095.
<td><input value=
"<?php echo $ShowwlhCalculate ?>"
/></td>
096.
<td><input value=
"<?php echo $showresult ?>"
/></td>
097.
<td><input value=
"<?php echo $showPcs ?>"
/></td>
098.
<td><input value=
"<?php echo $showQuantity ?>"
/></td>
099.
<td><input value=
"<?php echo $showTotalWeight ?>"
/></td>
100.
<td height=
"25"
bgcolor=
"#FFFFFF"
>
101.
<button
class
=
"addRow"
type=
"button"
>+</button>
102.
<button
class
=
"removeRow"
type=
"button"
>-</button>
103.
</td>
104.
</tr>
105.
106.
</table>
107.
110.
<script type=
"text/javascript"
>
111.
$(
function
(){
112.
113.
var
num_clone = 0;
114.
$(
".addRow"
).on(
"click"
,
function
(){
115.
num_clone++;
116.
117.
118.
119.
$(
"#firstTr:eq(0)"
).clone(true)
120.
.find(
"input"
).val(
""
).
end
()
121.
.appendTo($(
"#myTbl"
));
122.
});
123.
124.
$(
".removeRow"
).on(
"click"
,
function
(){
125.
var
indexThis = $(
".removeRow"
).index($(this));
126.
127.
if
($(
"#myTbl tr"
).length>1){
128.
$(
"#myTbl tr:eq("
+indexThis+
")"
).remove();
129.
}
else
{
130.
131.
alert(
"ต้องมีรายการข้อมูลอย่างน้อย 1 รายการ"
);
132.
}
133.
});
134.
135.
});
136.
</script>
137.
138.
139.
143.
</body>
144.
</html>