?? search_ach4.asp
字號:
<!--#include file="conn.asp"-->
<%
if session("user")="" then
response.write "您無此權限"
response.end
end if
%>
<%
dim level,subject,testno
level=trim(request("level"))
subject=trim(request("subject"))
testno=trim(request("testno"))
%>
<%
set rs=server.createobject("adodb.recordset")
select case level
case 1
sql="select * from ach where ach>=90 and subject='"&subject&"' and testno='"&testno&"' order by ach desc"
case 2
sql="select * from ach where ach>=80 and ach<=89 and subject='"&subject&"' and testno='"&testno&"' order by ach desc"
case 3
sql="select * from ach where ach>=70 and ach<=79 and subject='"&subject&"' and testno='"&testno&"' order by ach desc"
case 4
sql="select * from ach where ach>=60 and ach<=69 and subject='"&subject&"' and testno='"&testno&"' order by ach desc"
case else
sql="select * from ach where ach<60 and subject='"&subject&"' and testno='"&testno&"' order by ach desc"
end select
'response.write sql
rs.open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>查詢結果</title>
<link rel="stylesheet" href="style.css">
</head>
<body topmargin="0">
<!--#include file="top.asp"-->
<div align="center">
<table border="1" width="600" cellspacing="0" cellpadding="4" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr>
<td width="388" colspan="6" align="center">
<p align="left">查詢結果</p>
</td>
</tr>
<center>
<%
if Not(rs.bof and rs.eof) then'判別數據表中是否為空記錄
NumRecord=rs.recordcount
rs.pagesize=10
NumPage=rs.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if
else
NumRecord=0
NumPage=0
NoncePage=0
end if
%>
<tr>
<td width="107" align="center">準考證號</td>
<td width="108" align="center">姓名</td>
<td width="108" align="center">班級</td>
<td width="108" align="center">考次</td>
<td width="108" align="center">科目</td>
<td width="46" align="center">成績</td>
</tr>
<%if Not(rs.bof and rs.eof) then
rs.move (Cint(NoncePage)-1)*10,1
for i=1 to rs.pagesize
%>
<tr>
<td width="107" align="center"><%=rs("user_testnumber")%></td>
<td width="108" align="center"><%=rs("user_name")%></td>
<td width="108" align="center"><%=rs("user_class")%></td>
<td width="108" align="center"><%=rs("testno")%></td>
<td width="108" align="center"><%=rs("subject")%></td>
<td width="46" align="center"><%=rs("ach")%></td>
</tr>
<% rs.movenext
if rs.eof then exit for
next
else
response.write "<tr><td colspan=13><marquee scrolldelay=120 behavior=alternate>沒有找到任何記錄!!!</marquee></td></tr>"
end if
rs.close
set rs=nothing
%>
</table>
</table>
</div>
<table width="748" border="0" align="center">
<tr>
<td height="17">
<div align="right">
<input type="hidden" name="page" value="<%=NoncePage%>">
<%
if NoncePage>1 then
response.write "|<a href=search_ach_4.asp?page=1>首 頁</a>| |<a href=search_ach_4.asp?page="&NoncePage-1&">上一頁</a>| "
else
response.write "|首 頁| |上一頁| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=search_ach_4.asp?page="&NoncePage+1&">下一頁</a>| |<a href=search_ach_4.asp?page="&NumPage&">尾 頁</a>|"
else
response.write "|下一頁| |尾 頁|"
end if
%>
頁次:<font color="#0033CC"><%=NoncePage%></font>/<font color="#0033CC"><%=NumPage%></font>
共<font color="#0033CC"><%=NumRecord%></font>條記錄 </div>
</td>
</table>
</center>
</div>
<!--#include file="foot.asp"-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -