<!--#Include virtual="/info/gloab/global.asp"-->
<%
Set conn=server.CreateObject ("adodb.connection")
conn.ConnectionString =F_strconnection
conn.open
if err.number<>0 then
response.Write"数据库连接错误"
conn.Close
end if
set rsStu_level = Server.CreateObject("ADODB.RecordSet")
strStu_level="select stu_level from stu_levellist"
'查询入学年级
rsStu_level.Open strStu_level,conn,1,1
set rsFwz = Server.CreateObject("ADODB.RecordSet")
strFwz="select fdzID,fdzname from fdzlist"
'查询教学服务站
rsFwz.Open strFwz,conn,1,1
set rsStudyKind= Server.CreateObject("ADODB.RecordSet")
strStudyKind="select * from studykindlist order by studykindid"
'查询层次
rsStudyKind.Open strStudyKind,conn,1,1
set rsSubject = Server.CreateObject("ADODB.RecordSet")
strSubject="select * from subjectsys"
'查询专业
rsSubject.Open strSubject,conn,1,1
stu_level=request.Form("stu_level")
fdzid=request.Form("fdzid")
studykindid=request.Form("studykindid")
subjectid=request.Form("subjectid")
studentname=request.Form("studentname")
cardid=request.Form("cardid")
page=CInt(request.Form("page"))
rdo=request.Form("rdo")
%>
<html xmlns="http://www.
<head>
<title>报名信息查询</title>
<script type="text/javascript">
//级联
function cascade(x)
{
var temp=document.form1.subjectid;
var tStr="";
var tAry;
var cnt;
temp.options.length=0;
for(var i=0;i<document.form1.Subject.length;i++)
{
tStr=document.form1.Subject[i].value;
tAry=tStr.split('|');
cnt=tAry[0];
if(cnt==x)
temp.options.add(new Option(tAry[1],tAry[2]));
}
}
//下一页
function pageDown()
{
document.form1.action="222.asp";
document.form1.page.value=parseInt(document.form1.page.value)+1;
document.form1.submit();
}
//最后一页
function pageEnd(PageNum)
{
document.form1.action="222.asp";
document.form1.page.value=parseInt(PageNum);
document.form1.submit();
}
//第一页
function pageHome()
{
document.form1.action="222.asp";
document.form1.page.value=parseInt(1);
document.form1.submit();
}
//上一页
function pageUp()
{
document.form1.action="222.asp";
document.form1.page.value=parseInt(document.form1.page.value)-1;
document.form1.submit();
}
function pageSubmit()
{
document.form1.action="222.asp";
document.form1.page.value=parseInt(1);
document.form1.submit();
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<div style="background:#99CCFF;text-align:center;">
<div style="text-align:center"><b>报名信息查询</b><p></p>
显示按:
<input name="rdo" type="radio" checked="checked" value="层次"/>层次
<input name="rdo" type="radio" value="专业号" />专业号
<input name="rdo" type="radio" value="档案号" />档案号
排序<br />
<br />
</div>
<table style="width: 766px; height: 63px" border="1" bordercolor="#808080" bordercolordark="#FFFFFF" bordercolorlight="#E1F5FF">
<tr>
<td style="width: 265px; height: 34px;">
入学年级:
<select name="stu_level" style="width: 158px; height: 21px;">
<option value="">请 选 择</option>
<%
do while not rsStu_level.eof
%>
<% if
rsStu_level("stu_level")=stu_level then %>
<option selected value="<%=rsStu_level("stu_level") %>"><%=rsStu_level("stu_level") %></option>
<%else %>
<option
value="<%=rsStu_level("stu_level") %>"><%=rsStu_level("stu_level") %></option>
<%end if %>
<%
rsStu_level.movenext
loop
%>
</select>
</td>
<td style="width: 305px; height: 34px;">
教学服务站:
<select name="fdzid" style="width: 200px; height: 21px;">
<option value="">全 部</option>
<%
do while not rsFwz.eof
%>
<%if rsFwz("fdzid")=fdzid then %>
<option selected value="<%=rsFwz("fdzid") %>"><%=rsFwz("fdzname") %></option>
<%else %>
<option value="<%=rsFwz("fdzid") %>"><%=rsFwz("fdzname") %></option>
<%end if %>
<%
rsFwz.movenext
loop
%>
</select>
</td>
</tr>
<tr>
<td style="width: 265px; height: 33px;">
层 次:<select name="studykindid" style="width: 162px; height: 21px;" onchange="cascade(this.options.value)">
<option value="">请 选 择</option>
<%
do while not rsStudyKind.eof
%>
<%if rsStudyKind("StudyKindid")=studykindid then %>
<option selected value="<%=rsStudyKind("StudyKindid") %>"><%=rsStudyKind("StudyKind") %></option>
<%else %>
<option value="<%=rsStudyKind("StudyKindid") %>"><%=rsStudyKind("StudyKind") %></option>
<%end if %>
<%
rsStudyKind.movenext
loop
%>
</select>
</td>
<td style="width: 305px; height: 33px;">
专
业:<select name="subjectid" style="width: 198px; height: 10px;">
<option value="">全 部</option>
<%
do until rsSubject.eof
%>
<%if rsSubject("Subjectid")=subjectid then %>
<option selected value="<%=rsSubject("Subjectid") %>"><%=rsSubject("Subject") %></option>
<%else %>
<option value="<%=rsSubject("Subjectid") %>"><%=rsSubject("Subject") %></option>
<%end if %>
<%
rsSubject.movenext
loop
%>
</select>
</td>
<%
rsSubject.movefirst
do until rsSubject.eof
Response.write "<input type='hidden' name='Subject' value="&rsSubject("studykindid")&"|"&rsSubject("subject")&"|"&rsSubject("subjectid")&" >"&Chr(13)
rsSubject.MoveNext
Loop
%>
</tr>
</table>
<br />
或<br />
<br />
<table border="1" style="width: 764px; height: 28px" bordercolor="#808080" bordercolordark="#FFFFFF" bordercolorlight="#E1F5FF">
<tr>
<td style="width: 310px; height: 31px">
姓 名:<input name="studentname" style="width: 223px; height: 22px;" type="text" /></td>
<td style="width: 358px; height: 31px">
证件号码:<input name="cardid" style="width: 269px; height: 22px;" type="text" /></td>
</tr>
</table>
<br />
<input name="btnQuery" type="button" value="查
询" style="width: 74px" onclick="pageSubmit()" />
<br />
<br />
<table style="width: 859px; height: 11px" border="1" bordercolor="#808080" bordercolordark="#FFFFFF" bordercolorlight="#E1F5FF">
<tr bgcolor="#E1F5FF">
<td style="width: 154px; height: 8px" align="center">
入学年级
</td>
<td style="width: 367px; height: 8px"
align="center">
教学服务站
</td>
<td style="width: 291px; height: 8px"
align="center">
层次
</td>
<td style="width: 216px; height: 8px"
align="center">
专业
</td>
<td style="width: 199px; height: 8px"
align="center">
入学方式
</td>
<td style="width: 154px; height: 8px"
align="center">
姓名
</td>
<td style="width: 149px; height: 8px" align="center">
证件号码
</td>
<td style="width: 151px; height: 8px"
align="center">
档案号
</td>
<td style="width: 200px; height: 8px"
align="center">
报名方式
</td>
</tr>
<%
set rsCondition = Server.CreateObject("ADODB.RecordSet")
dim strCondition
strCondition="select top 100 stu.stu_level,fdz.fdzname,st.studykind,sub.subject,stu.entranceway,stu.studentname,stu.cardid,stu.archieveid,stu.signstate"
strCondition=strCondition+" from stusignsys as stu,fdzlist as fdz,studykindlist as st,subjectsys as sub where 1=1"
if studentname<>"" and cardid<>"" then
strCondition=strCondition+" and stu.studentname='" & studentname & "' and stu.cardid='" & cardid & "'"
else
if stu_level<>"" then
strCondition=strCondition+" and stu.stu_level='" & stu_level & "'"
end if
if fdzid<>"" then
strCondition=strCondition+" and fdz.fdzid='" & fdzid & "'"
end if
if studykindid<>"" then
strCondition=strCondition+" and st.studykindid='" & studykindid & "'"
end if
if subjectid<>"" then
strCondition=strCondition+" and sub.subjectid='" & subjectid & "'"
end if
end if
if rdo="专业号" then
strCondition=strCondition+" order by sub.subject"
else if rdo="档案号" then
strCondition=strCondition+" order by stu.archieveid"
else
strCondition=strCondition+" order by st.studykind"
end if
end if
rsCondition.Open strCondition,conn,1,1
%>
<%
rsCondition.PageSize=10
'每页100条记录
PageNum=rsCondition.PageCount
'总共10页
if page<=0 then page=1
'因为then之后的语句没有换行,所以无需加End if
if page="" then page=1
if rsCondition.eof and rsCondition.bof then
response.write ("暂时还没有数据")
else
rsCondition.AbsolutePage=page
for i=1 to rsCondition.PageSize
if rsCondition.eof then exit for
%>
<tr>
<td style="width: 154px; height: 28px" align="center">
<%=rsCondition("stu_level")%>
</td>
<td style="width: 367px; height: 28px" align="center">
<%=rsCondition("fdzname") %>
</td>
<td style="width: 291px; height: 28px" align="center">
<%=rsCondition("StudyKind") %>
</td>
<td style="width: 216px; height: 28px" align="center">
<%=rsCondition("Subject") %>
</td>
<td style="width: 199px; height: 28px" align="center">
<%=rsCondition("entranceway") %>
</td>
<td style="width: 154px; height: 28px" align="center">
<%=rsCondition("studentname") %>
</td>
<td style="width: 149px; height: 28px" align="center">
<%=rsCondition("cardid") %>
</td>
<td style="width: 151px; height: 28px" align="center">
<%=rsCondition("archieveid") %>
</td>
<td style="width: 200px; height: 28px" align="center">
<%
select case rsCondition("signstate")
case 0
response.Write ("网上")
case else
response.Write ("纸介")
end select
%>
</td>
</tr>
<%
rsCondition.movenext
%>
<%
next
end if
%>
</table>
<br />
<br />
</div>
<p align="center">
<% if page=1 and not page=PageNum Then %>
<font color='#008000'>第一页|上一页|</font>
<font color='#008000'><a href="#" onclick="javascript:pageDown()">下一页</a>|</font>
<font color='#008000'><a href="#" onclick="javascript:pageEnd('<%=PageNum%>')">最后一页</a>|</font>
<font color='#008000'><% else if page<>1 and not page=PageNum Then%></font>
<font color='#008000'><a href="#" onclick="javascript:pageHome()">第一页</a>|</font>
<font color='#008000'><a href="#" onclick="javascript:pageUp()">上一页</a>|</font>
<font color='#008000'><a href="#" onclick="javascript:pageDown()">下一页</a>|</font>
<font color='#008000'><a href="#" onclick="javascript:pageEnd('<%=PageNum%>')">最后一页</a>|</font>
<font color='#008000'><% else if page=PageNum then%></font>
<font color='#008000'><a href="#" onclick="javascript:pageHome()">第一页</a>|</font>
<font color='#008000'><a href="#" onclick="javascript:pageUp()">上一页</a>|</font>
<font color='#008000'>下一页|</font>
<font color='#008000'>最后一页</font>
<%
end if
end if
end if
%>
<% Response.Write("<font color='#008000'>
第"&page&"页 共"&rsCondition.RecordCount&"条记录 共"&PageNum&"页</font>")
%>
</p>
<input type="hidden" name="page" value="<%=page%>" />
</form>
</body>
</html>
代码有点长,三个单选按钮就在form表单最开始的地方