<! version 2.25July46 by burin rujjanapan from yonok.ac.th>
<%
dim connect, rs, sql, tots, i, j, k, l, nextl, max
set connect = server.createobject("ADODB.Connection")
%><!--#include file="connectinfo.asp"--><!--#include file="header.asp"--><%
if len(request.querystring("tumbon")) > 2 and len(request.querystring("menu")) = 3 then
sql = "select * from tb where tbid = '" & request.querystring("tumbon") &"' order by tbid"
set rs = server.createobject("ADODB.recordset")
rs.open sql,connect,1,3
tots = rs.recordcount
if tots > 0 then
i = 1
max = rs("linenews")
response.write("<table width=100% border=0 cellpadding=1 cellspacing=1")
response.write("><td width=200 valign=top bgcolor=black align=center><table border=0 cellpadding=1 cellspacing=1 bgcolor=black width=200>")
do while not rs.eof and i < 16
response.write("<tr><td bgcolor=#ffffdd align=center><font size=4>")
response.write("<a href=tb.asp?tumbon=" &request.querystring("tumbon") &"&menu=m00>"&rs("name")&"</a>")
if len(rs("url"))>0 then
response.write(" [<a href='"& rs("url")&"' style=TEXT-DECORATION:none;>web</a>]")
end if
response.write("</font></td></tr>")
for j = 1 to 20
if j < 10 then
l = "m0" & j
k = rs("m0"& j)
else
l = "m" & j
k = rs("m"& j)
end if
if not isnull(k) and len(k) > 2 then
response.write("<tr><td>")
keeptmp = "tb.asp?tumbon="&request.querystring("tumbon")& "&menu="&l
%>
<applet code="fphover.class" codebase="" width="200" height="20">
<param name="text" value="<%= k %>">
<param name="color" value="#000000">
<param name="hovercolor" value="#0000ff">
<param name="textcolor" value="#FFFFFF">
<param name="effect" value="glow">
<param name="url" value="<%= keeptmp %>" valuetype="ref">
<param name="target" value="_top">
<param name="bgcolor" value="#FFFFFF">
</applet>
<%
response.write("</td></tr>")
end if
if l = request.querystring("menu") then
nextl = k
end if
next
rs.movenext
i = i + 1
loop
response.write("</table></td><td valign=top>")
response.write("<center><font size=6>" & nextl &"</font></center><hr color=blue>")
if (request.querystring("menu") = "m00") then
sql = "select * from tb where tbid = '" & request.querystring("tumbon") &"'"
else
sql = "select * from tbm where tbid = '" & request.querystring("tumbon") &"' and m ='" &request.querystring("menu")&"'"
end if
set rs = server.createobject("ADODB.recordset")
rs.open sql,connect,1,3
tots = rs.recordcount
if tots > 0 then
if (request.querystring("menu") = "m00") then
response.write(rs("m00"))
else
response.write(rs("mdesc"))
end if
else
response.write("<br>ยังไม่มีข้อมูลในฐานข้อมูล")
end if
if max > 0 and request.querystring("menu") = "m00" then
response.write("<div id=m1 style='position:absolute; left:430px; top:70px; width:330px; z-index:1;'>")
response.write("<table width=100% border=0><tr bgcolor=#808080><td align=center>ข่าวประกาศ</td></tr>")
connectnews
sql = "select * from news where owner = '"& request.querystring("tumbon") &"'order by nid desc"
displaynewsintb
response.write("</table></div>")
end if
response.write("</td></table>")
else
response.write("<br>ยังไม่มีข้อมูลในฐานข้อมูล")
end if
connect.close
set rs = nothing
set connect = nothing
else
response.write("<br>การเรียกใช้งานไม่ถูกต้อง<br>")
response.write("ตัวอย่างที่ถูกต้อง <a href=tb.asp?tumbon=a00&menu=m00>tb.asp?tumbon=a00&menu=m00</a>")
end if
%>
<!--#include file="footer.asp"-->
</body></html>
<%
sub connectnews
connect.close
%><!--#include file="connectnews.asp"--><%
end sub
sub displaynewsintb
set rs = server.createobject("ADODB.recordset")
rs.open sql,connect,1,3
tots = rs.recordcount
if tots > 0 then
i = 1
do while not rs.eof and i <= max
response.write("<tr bgcolor=#dddddd><td>"&rs("showdate") & " :: <a href=displaynews.asp?niddtl="&rs("nid")&">")
response.write(rs("nshort")&"</a></td></tr>")
rs.movenext
i = i + 1
loop
else
response.write("<br>ยังไม่มีข้อมูลในฐานข้อมูล")
end if
end sub
%>
จำนวน : 119 บรรทัด