⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 用ASP写的学生管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
end select
else'模糊查询
if searchkey="男" then
    searchkey ="1"
	elseif searchkey="女" then
    searchkey="0"
end if
rs.open "select Userid,UserName,Sex,Birthday,Banji from [user] where Userid like '%"&searchkey&"%' or UserName like '%"&searchkey&"%' or Sex like '%"&searchkey&"%' or Birthday like '%"&searchkey&"%' or Banji like '%"&searchkey&"%' ",conn,1,1
end if
 if err.number<>0 then
				response.write "数据库中暂时无数据"
 end if
  if rs.bof And rs.eof then
       			Response.Write "<p align='center' > 对不起,没有您要查询的学生!</p>"
    else
	  			totalPut=rs.recordcount
         if currentpage<1 then
          	currentpage=1
      	end if
         if (currentpage-1)*MaxPerPage>totalput then
	   			if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut \ MaxPerPage
	   			else
	      					currentpage= totalPut \ MaxPerPage + 1
	   			end if
      	 end if
         if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"search.asp"
       			else
          			if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookmark
            				bookmark=rs.bookmark
            				showContent
             				showpage totalput,MaxPerPage,"search.asp"
        			else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"search.asp"
	      			end if
	   	end if
  end if

   				sub showContent
       			dim i
	   			i=0

			
%> 						
	 <table id=table28 align="center" cellSpacing=0 cellPadding=0  width=557 height=135 border=0>
           <tr>
    <th scope="col" width="10%">登陆学号</th>
    <th scope="col" width="10%">学生姓名</th>
    <th scope="col" width="10%">性别</th>
    <th scope="col" width="10%">出生年月</th>
    <th scope="col" width="10%">所在班级</th>
    <th scope="col" width="10%">其他功能</th>
</tr>
<%do while not rs.eof
    if rs("Sex")=1 then
	   xb="男"
	 else xb="女"
	 end if 
 %> 
  <tr height=8>
    <td width="10%" align="center"><%=trim(rs("Userid"))%></td>
    <td width="10%" align="center" ><%=trim(rs("UserName"))%></td>
    <td width="10%" align="center"><%=xb%></td>
    <td width="10%" align="center"><%=trim(rs("Birthday"))%></td>
    <td width="10%" align="center"><%=trim(rs("Banji"))%></td>
    <td><div align="center">管理</div></td>
  </tr>
  <%i=i+1
		if i>=MaxPerPage then Exit Do
		rs.movenext
  loop
  rs.close
  set rs=nothing%> 
	</table>
	 <%  
				End Sub   
  
				Function showpage(totalnumber,maxperpage,filename)  
  				Dim n
  				
				If totalnumber Mod maxperpage=0 Then  
					n= totalnumber \ maxperpage  
				Else
					n= totalnumber \ maxperpage+1  
				End If
				session("searchkey")=searchkey
				session("searchid")=searchid
				Response.Write "<form method=Post action="&filename&"?searchkey="&searchkey&"&searchid="&searchid&">"  
				Response.Write "<p align='center' class='contents'> "  
				If CurrentPage<2 Then  
					Response.Write "<font class='contents'>首页 上一页</font> "  
				Else  
					Response.Write "<a href="&filename&"?page=1&searchkey="&searchkey&"&searchid="&searchid&" class='contents'>首页</a> "  
					Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&searchkey="&searchkey&"&searchid="&searchid&" class='contents'>上一页</a> "  
				End If
				
				If n-currentpage<1 Then  
					Response.Write "<font class='contents'>下一页 尾页</font>"  
				Else  
					Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&searchkey="&searchkey&"&searchid="&searchid&" class='contents'>"  
					Response.Write "下一页</a> <a href="&filename&"?page="&n&"&searchkey="&searchkey&"&searchid="&searchid&" class='contents'>尾页</a>"  
				End If  
					Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
					Response.Write "<font class='contents'> 共查讯到"&totalnumber&"个符合条件的同学 " 
					Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">" 
					'Response.Write "<input type='hidden' name='searchkey' value="&searchkey&"> "
					'Response.Write "<input type='hidden' name='searchid' value="&searchid&"> "
					Response.Write "&nbsp;<input type='submit'  class='contents' value='GO' name='cndok'></form>"  
				End Function  
   %>
  <TR><TD width=568 colSpan=2 height=16><IMG height=16 src="images/bjbg_6.jpg" width=568 border=0></TD>
  </TR></TABLE>
      <TABLE id=table15 height=131 cellSpacing=0 cellPadding=0  width=568 border=0>
          <TBODY>
              <TR>
                 <TD width=146 background=images/bjbg_1.jpg height=35>
					<TABLE id=table16 height=20 cellSpacing=0 cellPadding=0 width="100%" border=0>
                        <TBODY>
                          <TR>
                            <TD align=middle><FONT style="FONT-SIZE: 12px" color=#ff0000>支持模糊查询</FONT></TD>
						</TR></TBODY>
					  </TABLE>
				 </TD>
                 <TD width=422 height=35><IMG height=35 src="images/bjbg_2.jpg" width=422 border=0></TD>
			   </TR>
               <TR><TD align=middle width=568 background=images/bjbg_3.jpg colSpan=2>
			   
			   <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <th width="15%" scope="col"><span class="td">搜索学生</span></th>
    <th width="68%" scope="col">&nbsp;</th>
    <th width="17%" scope="col">&nbsp;</th>
  </tr>
  <tr>
    <td valign="top"><div align="center">选择搜索条件</div></td>
    <td colspan="2" align="center">
	<form name="form1" method="post" action="search.asp">
      <select name="searchid">
        <option value='Userid' selected>根据登陆学号搜索</option>
        <option value='UserName'>根据学生姓名搜索</option>
        <option value='Sex'>根据学生性别搜索</option>
        <option value='Birthday'>根据出生年月搜索</option>
        <option value='Banji'>根据学生班级搜索</option>
      </select>
      
      关键字<input name="searchkey" type="text" size="15" maxlength="15">
      支持模糊<input type="checkbox" name="mohu" value="1">
	  <input type="submit" name="Submit" value="开始查找" onclick="return checkk();">
    </form></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">※提示:支持模糊搜索,可根据一个或多个条件进行搜索,非搜索条件可空出。 </div></td>
  </tr>
</table>
	             </TD>
    <TR><TD width=568 colSpan=2 height=16><IMG height=16 src="images/bjbg_6.jpg" width=568 border=0></TD>
				</TR>
				
			</TABLE>
			
                  
                        </TABLE></TD></TABLE>
<DIV align=center>
<CENTER>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 height=76 
cellSpacing=0 cellPadding=0 width=763 border=0>
  <TBODY>
  <TR>
    <TD width=763 background=images/xiabg_3.jpg height=76>
      <DIV align=center>
      <TABLE id=table34 cellSpacing=0 cellPadding=0 width="98%" border=0>
        <TBODY>
        <TR>
          <TD align=middle><FONT color=#051547><SPAN 
            style="FONT-SIZE: 12px">CopyRingt 2006&nbsp; 
        清水河源工作室</SPAN></FONT></TD>
        </TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></CENTER></DIV>
<DIV></DIV></BODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -