01.
<html>
02.
<head>
03.
</head>
04.
<body>
05.
<?php
06.
include
(
"bar.php"
);
07.
include
(
"config.php"
);
08.
?>
09.
<form action=
"update_save.php?CusID=<?php echo $_GET["
CusID
"]?>"
name=
"frmEdit"
method=
"post"
>
10.
<?php
11.
12.
$strSQL
=
"SELECT * FROM School WHERE Code = '"
.
$_GET
[
"CusID"
].
"' "
;
13.
$strSQL2
=
"SELECT Amphur FROM School "
;
14.
$objRec
=
$strConn
->Execute(
$strSQL
);
15.
$objRec2
=
$strConn
->Execute(
$strSQL2
);
16.
17.
18.
if
(
$objRec
->EOF)
19.
{
20.
echo
(
"Not found Code="
.
$_GET
[
"CusID"
]);
21.
}
22.
else
23.
{
24.
25.
26.
?>
27.
<table width=
"600"
border=
"1"
>
28.
<tr>
29.
<th width=
"180"
> <div align=
"center"
>Code </div></th>
30.
<th width=
"100%"
> <div align=
"center"
>SchoolName </div></th>
31.
<th width=
"198"
> <div align=
"center"
>Amphur </div></th>
32.
<th width=
"200"
> <div align=
"center"
>Zone </div></th>
33.
<th width=
"70"
> <div align=
"center"
>CourseStatus </div></th>
34.
<th width=
"70"
> <div align=
"center"
>RegStatus </div></th>
35.
<th width=
"198"
> <div align=
"center"
>Amphur </div></th>
36.
</tr>
37.
<tr>
38.
<td><div align=
"center"
>
39.
<input type=
"text"
name=
"txtCode"
size=
"5"
value=
"<?php echo $objRec->Fields["
Code
"]->Value;?>"
>
40.
</div></td>
41.
<td><input type=
"text"
name=
"txtSchoolName"
size=
"20"
value=
"<?php echo $objRec->Fields["
SchoolName
"]->Value;?>"
></td>
42.
43.
44.
45.
<td></td>
46.
47.
48.
49.
50.
<td><div align=
"center"
>
51.
<input type=
"text"
name=
"txtZone"
size=
"2"
value=
"<?php echo $objRec->Fields["
Zone
"]->Value;?>"
>
52.
</div></td>
53.
<td align=
"right"
><input type=
"text"
name=
"txtCourseStatus"
size=
"5"
value=
"<?php echo $objRec->Fields["
CourseStatus
"]->Value;?>"
></td>
54.
<td align=
"right"
><input type=
"text"
name=
"txtRegStatus"
size=
"5"
value=
"<?php echo $objRec->Fields["
RegStatus
"]->Value;?>"
></td>
55.
56.
<td><select name=
"province2"
class
=
""
onChange=
"province2Select(this.value)"
>
57.
<option value=
""
></option>
58.
<?php While (!
$objRec2
->EOF)
59.
{
60.
?>
61.
62.
<option value=
"เลือกAmphur"
size=
"50"
>
63.
<?php
echo
$objRec2
->Fields[
"Amphur"
]->Value;?>
64.
</option>
65.
66.
<?php
$objRec2
->MoveNext();
$objRec
->MoveNext();
67.
} ?>
68.
</select>
69.
</td>
70.
</tr>
71.
72.
</table>
73.
<input type=
"submit"
name=
"submit"
value=
"submit"
>
74.
<?php
75.
}
76.
$objRec
->Close();
77.
$objRec2
->Close();
78.
$strConn
->Close();
79.
$strConn2
->Close();
80.
$strConn
= null;
81.
$strConn2
= null;
82.
?>
83.
</form>
84.
</body>
85.
</html>