001.
<%
002.
pageLen = 12 //กำหนดจำนวนแต่ละหน้าที่ต้องการแสดงกี่ Reccord
003.
pageNo = request.QueryString(
"pageNo"
)
004.
if pageNo=
""
then pageNo = 1
005.
006.
Call
OpenConnect(sql)
007.
sql =
"Select * From RESDETAIL_VIEW Where Res_ID >0"
008.
Set
Rs = Server.CreateObject(
"ADODB.Recordset"
)
009.
Rs.Open sql,Conn,1,3
010.
011.
Nrecord=RS.RecordCount
012.
Rs.PageSize = pageLen
013.
totalPage = Rs.PageCount
014.
Rs.AbsolutePage = pageNo
015.
016.
If
Rs.EOF
Then
%>
017.
ไม่มีข้อมูลในตาราง !
018.
<%
Else
%>
019.
020.
<table width=
"90%"
border=
"0"
align=
"center"
cellpadding=
"0"
>
021.
<tr>
022.
<td colspan=
"7"
><font size=
"3"
><B>โครงการวิจัย</B></font></td>
023.
<tr bgcolor=
"Silver"
>
024.
<td width=
"50"
><div align=
"center"
><font size=
"2"
>ปีงบประมาณ</font></div></td>
025.
<td width=
"1000"
><div align=
"center"
><font size=
"2"
>ประเภทโครงการ</font></div></td>
026.
<td width=
"5000"
><div align=
"center"
><font size=
"2"
>ชื่อโครงการ</font></div></td>
027.
<td width=
"1200"
><div align=
"center"
><font size=
"2"
>หัวหน้าโครงการ</font></div></td>
028.
<td width=
"1000"
><div align=
"center"
><font size=
"2"
>แหล่งทุน</font></div></td></tr>
029.
030.
<%
031.
recNo=1
032.
Do
While
Not
RS.EOF and recNo <= pageLen%>
033.
034.
<tr<% if color=0 then %> bgcolor=#eeeeee <% color=1
035.
else%>bgcolor=#fefefe<% color=0 end if %>>
036.
<td><div align=
"center"
><font size=
"2"
><%= Rs(
"Res_Budget_Year"
)%></font></div></td>
037.
<td><font size=
"2"
><%= Rs(
"TTyp_Type"
)%></font></td>
038.
<td><font size=
"2"
><%= Rs(
"Res_Name_th"
)%></font></td>
039.
<td><font size=
"2"
><%= Rs(
"Title_Faculty"
)&Rs(
"Th_Name"
)&
" "
&Rs(
"Th_Surname"
)%></font></td>
040.
<td><font size=
"2"
><%= Rs(
"TTSB_Name"
)%></font></td></tr>
041.
042.
<%
043.
recNo=recNo+1
044.
Rs.MoveNext
045.
Loop
046.
//rs.close :
Set
rs=
Nothing
047.
Rs.close
048.
Set
Rs=
Nothing
049.
Call
CloseConnect %>
050.
051.
<% end if %>
052.
053.
<tr><td colspan=
"7"
><br>
054.
<p align=
"left"
> <font color=
"#999999"
size=
"2"
><b>เลือกรูปแบบการค้นหา</b>
055.
<input type=
"radio"
name=
"Research"
value=
"1"
onClick=
"Show_List(this.value);"
>
056.
ปีงบประมาณ
057.
<input type=
"radio"
name=
"Research"
value=
"2"
onClick=
"Show_List(this.value);"
>
058.
ประเภทโครงการ
059.
<input type=
"radio"
name=
"Research"
value=
"3"
onClick=
"Show_List(this.value);"
>
060.
ชื่อโครงการ
061.
<input type=
"radio"
name=
"Research"
value=
"4"
onClick=
"Show_List(this.value);"
>
062.
หัวหน้าโครงการ
063.
<input type=
"radio"
name=
"Research"
value=
"5"
onClick=
"Show_List(this.value);"
>
064.
แหล่งทุน
065.
<input type=
"radio"
name=
"Research"
value=
"6"
onClick=
"Show_List(this.value);"
>
066.
ปีงบประมาณ+หัวหน้าโครงการ
067.
<input type=
"radio"
name=
"Research"
value=
"7"
onClick=
"Show_List(this.value);"
>
068.
ประเภทโครงการ+หัวหน้าโครงการ
069.
070.
<form name=
"form1"
method=
"GET"
action=
"budgetyear.asp"
target=
"_blank"
>
071.
<select name=
"select1"
id=
"select_1"
style=
"display:none"
>
072.
<option selected>กรุณาเลือกปีงบประมาณ</option>
073.
074.
<%
075.
Call
OpenConnect(sql)
076.
sql=
"Select distinct Res_Budget_Year from RESDETAIL_VIEW Where Res_ID > 0"
077.
Set
Rs = Server.CreateObject(
"ADODB.Recordset"
)
078.
Rs.Open sql,Conn,1,3
079.
%>
080.
<%while
Not
Rs.EOF%>
081.
<option value=
"<% =Rs("
Res_Budget_Year
")%>"
><% =Rs(
"Res_Budget_Year"
)%></option>
082.
<%Rs.MoveNext
083.
wend
084.
Rs.close
085.
Set
Rs=
Nothing
086.
Call
CloseConnect
087.
%>
088.
</select>
089.
<input type=
"submit"
name=
"Submit1"
value=
"ค้นหา"
style=
"display:none"
>
090.
</form>
091.
092.
<form name=
"form2"
method=
"GET"
action=
"typeresearch.asp"
target=
"_blank"
>
093.
<select name=
"select2"
id=
"select_2"
style=
"display:none"
>
094.
<option selected>กรุณาเลือกประเภทโครงการ</option>
095.
<%
096.
Call
OpenConnect(sql)
097.
sql=
"Select distinct TTyp_Type from RESDETAIL_VIEW Where Res_ID > 0"
098.
Set
Rs = Server.CreateObject(
"ADODB.Recordset"
)
099.
Rs.Open sql,Conn,1,3
100.
%>
101.
<%while
Not
Rs.EOF%>
102.
<option value=
"<% =Rs("
TTyp_Type
")%>"
><% =Rs(
"TTyp_Type"
)%></option>
103.
<%Rs.MoveNext
104.
wend
105.
Rs.close
106.
Set
Rs=
Nothing
107.
Call
CloseConnect
108.
%>
109.
</select>
110.
<input type=
"submit"
name=
"Submit2"
value=
"ค้นหา"
style=
"display:none"
>
111.
</form>
112.
113.
<br><br>
114.
115.
จำนวน <b><%=Nrecord%></b> โครงการ<br>
116.
ขณะนี้อยู่ที่หน้า <b><%=pageNo%></b> ในทั้งหมด <b><%=totalPage%></b> หน้า<br><br>
117.
118.
<% if cint(pageno) > 1 then %>
119.
120.
<a href=
"index.asp?pageNo=1"
>หน้าแรก</a> <a href=
"index.asp?pageNo=<%=pageNo-1%>"
>ย้อนกลับ</a>
121.
122.
<% end if
123.
if cint(pageno) < totalPage then %>
124.
125.
<a href=
"index.asp?pageNo=<%=pageNo+1%>"
>หน้าต่อไป</a> <a href=
"index.asp?pageNo=<%=totalPage%>"
>หน้าสุดท้าย</a>
126.
127.
<% end if %>
128.
<br><br>
129.
กระโดดไปหน้า
130.
<%for idx = 1 to totalPage %>
131.
<a href=
"index.asp?pageNo=<%=idx%>"
>
132.
<% if idx=cint(pageno) then%>
133.
<b><%=idx%></b>
134.
<%else %>
135.
<%=idx%>
136.
<%end if%>
137.
</a>
138.
<%
139.
next%>