01.
<html>
02.
<head>
03.
<title>Accessories Program Lives</title>
04.
<meta http-equiv=Content-Type content=
"text/html; charset=utf-8"
>
05.
06.
</head>
07.
08.
<body>
09.
<?php
10.
include
'connect.php'
;
11.
$RegDate
=
date
(
"Y-m-d H:i:s"
);
12.
if
(isset(
$_POST
[
'hdnCmd'
]) ==
"Update"
)
13.
{
14.
$sql
=
"UPDATE lf_order SET ocustomer = '"
.
$_POST
[
"txtocustomer"
].
"'WHERE oid = '"
.
$_POST
[
"txtoid"
].
"' "
;
15.
16.
$query
= mysqli_query(
$conn
,
$sql
);
17.
18.
19.
20.
}
21.
22.
23.
$strid
= null;
24.
25.
if
(isset(
$_GET
[
"lot"
]))
26.
{
27.
$strlot
=
$_GET
[
"lot"
];
28.
}
29.
30.
$sql
=
"SELECT * FROM lf_order WHERE (plot LIKE '%"
.
$_GET
[
"lot"
].
"%' and pid LIKE '%"
.
$_GET
[
"pid"
].
"%')"
;
31.
32.
$query
= mysqli_query(
$conn
,
$sql
);?>
33.
<table width=
"200"
border=
"1"
>
34.
<tr>
35.
<th scope=
"col"
>จำนวน</th>
36.
<th scope=
"col"
>LOT</th>
37.
<th scope=
"col"
>หมายเลข</th>
38.
<th scope=
"col"
>ประเภท</th>
39.
<th scope=
"col"
>รายละเอียด</th>
40.
<th scope=
"col"
>ราคา</th>
41.
<th scope=
"col"
>รายชื่อผู้ที่จองได้</th>
42.
<th scope=
"col"
>บันทึก</th>
43.
</tr>
44.
45.
<?php
46.
$num
=1;
47.
while
(
$result
=mysqli_fetch_array(
$query
,MYSQLI_ASSOC)){
48.
49.
?>
50.
<form name=
"frmMain"
method=
"post"
action=
"<?php echo $_SERVER["
PHP_SELF
"];?>"
>
51.
52.
<tr>
53.
<td><?php
echo
$num
++ ;?></td>
54.
<td><?php
echo
$result
[
"plot"
];?></td>
55.
<td><?php
echo
$result
[
"pid"
];?></td>
56.
<td><?php
echo
$result
[
"pname"
];?></td>
57.
<td><?php
echo
$result
[
"oetc"
];?></td>
58.
<td><?php
echo
$result
[
"pprice"
];?></td>
59.
<td><input type=
"text"
name=
"txtocustomer"
size=
"20"
value=
"<?php echo $result["
ocustomer
"];?>"
></td>
60.
<td><input type=
"hidden"
name=
"txtoid"
value=
"<?php $result["
oid
"];?>"
>
61.
<input type=
"hidden"
name=
"hdnCmd"
value=
""
>
62.
<input name=
"btnAdd"
type=
"button"
id=
"btnUpdate"
value=
"Update"
OnClick=
"frmMain.hdnCmd.value='Update';frmMain.submit();"
>
63.
</td>
64.
</tr>
65.
</form>
66.
<?php } ?>
67.
</table>
68.
69.
<?php
70.
71.
mysqli_close(
$conn
);
72.
?>
73.
</body>
74.
</html>