01.
<html>
02.
<head>
03.
<%
Dim
strSQL_mo,objRec_mo
04.
Dim
strSQL_ye,objRec_ye
05.
06.
keyword=Request.Form(
"keyword"
)
07.
08.
sql =
" select * from employees where emp_name like '%"
&keyword&
"%' or acc_id like '%"
&keyword&
"%'"
09.
Set
objRec = Server.CreateObject(
"ADODB.Recordset"
)
10.
objRec.Open sql,Conn1
11.
do while not objRec.EOF
12.
emp_name=objRec(
"emp_name"
)
13.
acc_id=objRec(
"acc_id"
)%>
14.
</head>
15.
<body>
16.
<form name=
"form1"
action=
"Add_insert.asp"
method=
"post"
>
17.
<table>
18.
<tr>
19.
<td><strong>ข้อมูลเงินกู้ธนาคาร</strong></td>
20.
</tr>
21.
<tr>
22.
<td align=
"right"
>ชื่อพนักงาน :</td>
23.
<td><input type=
"text"
name=
"emp_name"
value=
"<%=emp_name%>"
/></td>
24.
<td width=
"30"
></td>
25.
<td align=
"right"
>เลขที่บัญชีเงินกู้ :</td>
26.
<td><input type=
"text"
name=
"acc_id"
value=
"<%=acc_id%>"
/></td>
27.
<%objRec.movenext
28.
loop%>
29.
</tr>
30.
<tr>
31.
<td align=
"right"
>งวดเดือน :</td>
32.
<td>
33.
<%strSQL_mo =
"SELECT * FROM [month]"
34.
Set
objRec_mo = Server.CreateObject(
"ADODB.Recordset"
)
35.
objRec_mo.Open strSQL_mo,Conn1%>
36.
<select name=
"month"
>
37.
<%
Do
while not objRec_mo.EOF%>
38.
<option value=
"<%=objRec_mo("
month_id
")%>"
><%=objRec_mo(
"month_name"
)%></option>
39.
<%objRec_mo.movenext
40.
loop
41.
%>
42.
</select>
43.
<%strSQL_ye =
"SELECT * FROM [years]"
44.
Set
objRec_ye = Server.CreateObject(
"ADODB.Recordset"
)
45.
objRec_ye.Open strSQL_ye,Conn1%>
46.
<select name=
"year"
>
47.
<%
Do
while not objRec_ye.EOF%>
48.
<option value=
"<%=objRec_ye("
year_id
")%>"
><%=objRec_ye(
"year_id"
)%></option>
49.
<%objRec_ye.movenext
50.
loop
51.
%>
52.
</select>
53.
</td>
54.
<td></td>
55.
<td align=
"right"
>งวดที่ :</td>
56.
<td><input type=
"text"
name=
"a_time"
size=
"5"
/></td>
57.
<td width=
"20"
></td>
58.
<td align=
"right"
>จำนวนบาท :</td>
59.
<td><input type=
"text"
name=
"amount"
size=
"5"
/></td>
60.
</tr>
61.
<tr>
62.
<td><input type=
"submit"
name=
"btnsubmit"
value=
"---Add Record---"
/></td>
63.
</tr>
64.
</table>
65.
</form>
66.
</body>
67.
</html>