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

📄 showinfo.asp

📁 本文件为利用ASP开发的管理信息系统项目,文件名为校友录,按照说明"校友录系统_数据表创建方法"来进行数据表的创建.
💻 ASP
字号:
<%@ Language=VBScript %>
<%if not session("user_session_id")=Session.SessionID then%>
<SCRIPT LANGUAGE=javascript>
 parent.window.location.href="default.asp"
</SCRIPT>
<%end if%>
<html>
<head>
<LINK href="style/style.css" type=text/css rel=stylesheet>
<script>
function openScript(url){
	var Win = window.open(url,"openScript",'resizable=1,scrollbars=yes,menubar=no,status=no' );
}
</script>
<title>校友录-同学搜索</title>
<style TYPE="text/css"> 
<!-- 
 .popcomments 
{ 
position : absolute; width:130;
visibility : hidden; 
border: 1 solid #000001
} 
.in 
{
BORDER-RIGHT: rgb(127,127,127) 1px solid;
BORDER-TOP: rgb(127,127,127) 1px solid;
 FONT-SIZE: 9pt; 
 BORDER-LEFT: rgb(127,127,127) 1px solid; 
 BORDER-BOTTOM: rgb(127,127,127) 1px solid;
 BACKGROUND-COLOR: #ffffff
}
//--> 
</style> 
</head>
<body leftMargin=0 topMargin=0>
<!--#include file=inc/top.asp-->
<%
function sort(data)
    sort=Replace(data,"'","''")
end function

If session("ecid")<>"" Then
Dim count1,cont2,count3,sql,rst
if Request("count1")="" Then
  sql="select count(*) from ec where classid='1'"
  set rst=session("cn").execute (sql)
  count1=rst(0)
  rst.Close 
  sql="select count(*) from ec where classid='2'"
  set rst=session("cn").execute (sql)
  count2=rst(0)
  rst.Close
  sql="select count(*) from ec where classid='3'"
  set rst=session("cn").execute (sql)
  count3=rst(0)
  rst.Close
  set rsrt=nothing
else
  count1=Cint(Request("count1"))
  count2=Cint(Request("count2"))
  count3=Cint(Request("count3"))
end if
        if Request.Form ("classid")<>"" then
            classid=Trim(Request.Form ("classid"))
            stype=Trim(Request.Form ("stype"))
            keyword=Trim(Request.Form ("keyword"))
        else
           classid=Trim(Request.QueryString("classid"))
            stype=Trim(Request.QueryString ("stype"))
            keyword=Trim(Request.QueryString ("keyword"))
         end if
 %>
<br>
<table width="750" height="371" border="0" align="center" 
cellpadding="0" cellspacing="0">
  <tr> 
    <td valign=top width=145 height="390"> 
      <form name="form1" method="post" action="showinfo.asp">
        <br>
       &nbsp;&nbsp; 输入要查找的条件<p>
        <table border="0" cellpadding="0"  bordercolor="#111111"
         cellspacing="0" width="121" align="center">
          
          <tr> 
            <td width="38">类别:</td>
            <td width="86"> 
              <select size="1" name="stype">
                <option value="studentid" selected>用户名</option>
                <option value="sname">姓名</option>
               
              </select>
            </td>
          </tr>
          <tr> 
            <td width="38">搜索:</td>
            <td width="86"> 
              <input type="text" name="keyword" size="9"  
              maxlength="9" value="<%=keyword%>" class=in>
            </td>
          </tr>
          <tr> 
            <td align="center" colspan="2"> 
              <input type="hidden"  name=ecid value=<%=session("ecid")%>>
              <input type="submit" name="Submit" value="查看" class=in>
            </td>
          </tr>
        </table>
        <input type="hidden" name=count1 value=<%=count1%>>
        <input type="hidden" name=count2 value=<%=count2%>>
        <input type="hidden" name=count3 value=<%=count3%>>
        </form>
      <p><br>
      </p>
      </td>
    <td width="1" valign="top" bgcolor="#00CC00" height="390"> </td>
    <td width="565" valign="top" height="390"> 
   
      <%if Request("submit")<>"" then
        const pagesize=8
         sql="select studentid,sname,pic,oicq,email,lastedtime from ec "
        If keyword="" Then         '未填写搜索字
        Else  '写了搜索字的情况
            sql=sql&" where "&stype&" like '%"&keyword&"%'"          
        End If
        sql=sql&"order by studentid"
        Set rst=Server.CreateObject ("ADODB.Recordset")
        rst.Open sql,session("cn"),1
        if not rst.EOF then        
        rst.PageSize=pagesize
            topage=rst.PageCount 
        curpage=Request.QueryString("curpage")
           if curpage="" Then curpage=1
           curpage=cint(curpage)
           rst.AbsolutePage=curpage   
     %>
      <p align="right">共有记录<font color=red><b><%=rst.RecordCount%></b></font>条 
        共<font color=red><b><%=topage%></b></font>页 当前第
        <font color=red><b><%=curpage%></b></font>页 
        每页显示<font color=red><b><%=pagesize%></b></font>条 <br>
        <%if curpage<>1 then%>
        <a title=首页 href="showinfo.asp?curpage=1&classid=<%=classid%>&stype=<%=stype%>&keyword=<%=keyword%>&submit=action&count1=<%=count1%>&count2=<%=count2%>&count3=<%=count3%>">
        <font face="webdings" color="#0033FF">9</font></a> 
        <%else%>
        <a title=首页 href="#"><font face="webdings" color="#0033FF">9</font></a> 
        <%end if%>
        <%for i=1 to topage%>
        <a title="第<%=i%>页" href="showinfo.asp?curpage=<%=i%>&classid=<%=classid%>&stype=<%=stype%>&keyword=<%=keyword%>&submit=action&count1=<%=count1%>&count2=<%=count2%>&count3=<%=count3%>"><%=i%></a> 
        <%Next%>
        <%if curpage<>topage then%>
        <a title=尾页 href="showinfo.asp?curpage=<%=topage%>&classid=<%=classid%>&stype=<%=stype%>&keyword=<%=keyword%>&submit=action&count1=<%=count1%>&count2=<%=count2%>&count3=<%=count3%>">
        <font face=webdings>:</font></a> 
        <%else%>
        <a title=尾页 href="#"><font face=webdings>:</font></a> 
        <%end if%>
      <table cellpadding=0  align=right  bordercolor="#006666" width=538>
        <tr bgcolor=#cccccf> 
          <th width="79">学号</th>
          <th width="66">姓名</th>
          <th width=73>头像</th>
          <th width="83">OICQ</th>
          <th width="92">E-Mail</th>
          <th width="129">最近访问时间</th>
        </tr>
        <%
               For i=1 to rst.PageSize
	               if rst.EOF then exit for%>
        <tr align=center bgcolor=#e4eaef> 
          <td width="79" height="34"><b>
          <a href="javascript:openScript('profile.asp?name=<%=rst(0)%>',420,320)">
          <%=rst(0)%></a></b></td>
          <td width="66" height="34"><%=rst(1)%></td>
          <td width="73" height="34">
          <a href="javascript:openScript('profile.asp?name=<%=rst(0)%>',420,320)">
          <img border=0 width=35 src="img/<%=rst(2)%>.bmp"></a></td>
          <td width="83" height="34"><%=rst(3)%></td>
          <td width="92" height="34"><%=rst(4)%></td>
          <td width="129" height="34"><%=rst(5)%></td>
        </tr>
        <%
        rst.MoveNext 
        next
        %>
      </table>
      
      <%else
      Response.Write "还没有符合条件的记录……"
      end if
      end if%>
    </td>
  </tr>
</table>
 <%
%>
<hr width=700 color=green size=1>
<% else%>
 <script>
window.location.href="default.asp"
</script>
 <%end if%>

⌨️ 快捷键说明

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