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

📄 serch.asp

📁 流溪网络办公系统:管理员: 用户名:admin 密码:
💻 ASP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="connsf.asp" -->
<!--#include file="md5.inc" -->
<!--#include file="checkstr.asp" -->
<!--#include file="config.asp" -->
<%'检验用户
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,能否发送 from user_teacher where 用户名='"&user&"' and 密码='"&pass1&"'"
set rs=conn.execute(str)
if rs.eof then
    response.redirect("user_login.asp")
else
    user_name=rs("姓名")
	sendyesno=rs("能否发送")
end if
rs.close
%>

<%doing=Trim(Request.QueryString("doing"))%>

<%'清除信息
if doing="clear" then
   clear_id=cint(Request.QueryString("clear_id"))
   str="select 已清除者 from woa where id="&clear_id&""
   set rs=conn.execute(str)
   cleared=rs("已清除者")&user_name&"|"
   rs.close
   str="update woa set 已清除者='"&cleared&"' where id="&clear_id&" and 清除=1"
   conn.execute(str)
end if
%>
<%'删除信息
if doing="delete" then
    dele_id=cint(Request.QueryString("dele_id"))
	
	str="select 跟贴数,附件数,附件 from woa where id="&dele_id&" and 主题=1"
	 set rs=conn.execute(str)
	    if rs("跟贴数")>0 then	 '先删除该信息下的留言
		     str="select 附件数,附件 from woa where 跟贴主题="&dele_id&""
			 set rs1=conn.execute(str)
			     do while not rs1.eof
				     if rs1("附件数")>0 then
					      fj_file=rs1("附件")
						  do while len(fj_file)>1
		                      del_file=mid(fj_file,1,instr(fj_file,"|")-1)
			                  fj_file=mid(fj_file,instr(fj_file,"|")+1)
	                          del_file=Server.MapPath(del_file)
                              Set fs=Server.CreateObject("Scripting.FileSystemObject")
                              if fs.FileExists(del_file) then
                                    fs.DeleteFile del_file,True
                             end if
	                      loop
					 end if
				 rs1.movenext
				 loop
	         rs1.close
			 str="delete from woa where 跟贴主题="&dele_id&""
			 conn.execute(str)
	    end if
	 if rs("附件数")>0 then       '删除主题下的附件
	     fj_file=rs("附件")
			do while len(fj_file)>1
		        del_file=mid(fj_file,1,instr(fj_file,"|")-1)
			    fj_file=mid(fj_file,instr(fj_file,"|")+1)
	            del_file=Server.MapPath(del_file)
                Set fs=Server.CreateObject("Scripting.FileSystemObject")
                if fs.FileExists(del_file) then
                     fs.DeleteFile del_file,True
                end if
	            loop
	 end if
	 rs.close
     str="delete from woa where id="&dele_id&" and 发文者='"&user_name&"' and 主题=1"
     conn.execute(str)
	
end if
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<!--#include file="css.css" -->
</head>

<%
  keyword=Trim(Request("keyword"))
  sclass=Trim(Request("sclass"))
  looked=Trim(Request("looked"))
%>

<body topmargin="1"  oncontextmenu="return false">
<div align="center">
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tabletblg">
    <tr>
      <td><!--#include file="top.asp" --></td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td height="30" bgcolor="#6699FF">   
<!--#include file="menu.asp" -->
      </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td height="30" bgcolor="#6699FF" class="fontsize14">  <%=user_name%>,你好!欢迎使用留溪网上传文系统。  以下是你搜索得到的结果。</td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td bgcolor="#6699FF">
<table width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="fontsize10"> </td>
          </tr>
        </table>
        <table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff">
          <tr class="fontsize12"> 
            <td bgcolor="#99CCFF"> <div align="center"><strong>状态</strong></div></td>
            <td height="30" bgcolor="#99CCFF"> 
              <div align="center"><strong>主    题  </strong>(点击主题文字可浏览信息内容)</div></td>
            <td bgcolor="#99CCFF"> 
              <div align="center"><strong>发送人</strong></div></td>
            <td bgcolor="#99CCFF"> 
              <div align="center"><strong>日期</strong></div></td>
            <td bgcolor="#99CCFF"> 
              <div align="center"><strong>时间</strong></div></td>
            <td bgcolor="#99CCFF"> 
              <div align="center"><strong>点击</strong></div></td>
            <td bgcolor="#99CCFF"> 
              <div align="center"><strong>回复</strong></div></td>
            <td bgcolor="#99CCFF"> 
              <div align="center"><strong>操作</strong></div></td>
          </tr>
          <%'确定显示的信息
      user_name1="|"&user_name&"|"
    if looked="no" then
	  str="select * from woa where 主题=1 and (发文者='"&user_name&"' or (所有人='1' or 接收者 like '%"&user_name1&"%') and 已清除者 not like '%"&user_name1&"%') and 已看者 not like '%"&keyword&"%' and 发文者<>'"&user_name&"' order by 置顶 desc,发文日期 desc,发文时间 desc"
	else
      str="select * from woa where 主题=1 and (发文者='"&user_name&"' or (所有人='1' or 接收者 like '%"&user_name1&"%') and 已清除者 not like '%"&user_name1&"%') and "&sclass&" like '%"&keyword&"%' order by 置顶 desc,发文日期 desc,发文时间 desc"
    end if
	  rs.open str,conn,3,2
      rs.pagesize=msgpagesize
%>
          <% '确定显示的页码
   pageno=request("pageno")
     if isnumeric(pageno)=false then pageno=1 end if
   pageno=cint(pageno)
   if pageno="" or pageno<=0 then
     pageno=1
   end if
   if pageno>rs.pagecount then
     pageno=rs.pagecount
   end if
%>
          <%if rs.eof then%>
          <tr class="fontsize12"> 
            <td height="30" colspan="8" bgcolor="#99CCFF"><div align="center" class="fontsize14"><font color="#FF0000">没有任何信息。</font></div></td>
          </tr>
          <%else%>
          <%rs.absolutepage=pageno
     for n=1 to rs.pagesize%>
          <tr class="fontsize12"> 
            <td width="26" bgcolor="#99CCFF"> 
              <div align="center"> 
                <%if rs("置顶")=1 then%>
                <img src="images/locktop.gif"> 
                <%else%>
                <%if rs("发文者")=user_name then%>
                <img src="images/file1.gif"> 
                <%else%>
                <%if instr(rs("已看者"),"|"&user_name&"(")>0 then%>
                <img src="images/file2.gif"> 
                <%else%>
                <img src="images/file3.gif"> 
                <%end if%>
                <%end if%>
                <%end if%>
              </div></td>
            <td width="440" height="26" bgcolor="#99CCFF"> 
              <%if rs("跟贴数")>0 then%> <img src="images/cat.gif"> <%else%> <img src="images/cat1.gif"> <%end if%> <a href=disp.asp?disp_id=<%=rs("id")%>&pageno=<%=pageno%> class="fontsize12wu" onMouseOver="window.status='';return true"><%=left(rs("标题"),30)%> 
              <%if len(rs("标题"))>30 then response.write "……"%>
              </a> <%if rs("附件数")>0 then%> <img src="images/fujian.gif"> <%end if%>
            </td>
            <td width="50" bgcolor="#99CCFF"> 
              <div align="center"><a href=serch.asp?keyword=<%=rs("发文者")%>&sclass=发文者 class="fontsize12wu" onMouseOver="window.status='';return true"><%=rs("发文者")%></a></div></td>
            <td width="60" bgcolor="#99CCFF"> 
              <div align="center"><a href=serch.asp?keyword=<%=rs("发文日期")%>&sclass=发文日期 class="fontsize12wu" onMouseOver="window.status='';return true"><%=rs("发文日期")%></a></div></td>
            <td width="48" bgcolor="#99CCFF"> 
              <div align="center"><%=rs("发文时间")%></div></td>
            <td width="28" bgcolor="#99CCFF"> 
              <div align="center"><%=rs("点击数")%></div></td>
            <td width="28" bgcolor="#99CCFF"> 
              <div align="center"><%=rs("跟贴数")%></div></td>
            <td width="28" bgcolor="#99CCFF"> 
              <div align="center"> 
                <%if rs("发文者")=user_name then%>
                <a href=serch.asp?doing=delete&dele_id=<%=rs("id")%>&pageno=<%=pageno%>&keyword=<%=keyword%>&sclass=<%=sclass%> class="fontsize12wu" onMouseOver="window.status='';return true">删除</a> 
                <%else%>
                <a href=serch.asp?doing=clear&clear_id=<%=rs("id")%>&pageno=<%=pageno%>&keyword=<%=keyword%>&looked=no class="fontsize12wu" onMouseOver="window.status='';return true">清除</a> 
                <%end if%>
              </div></td>
          </tr>
          <%rs.movenext
	     if rs.eof then exit for
	  next%>
          <%end if%>
          <tr class="fontsize12"> 
            <td height="30" colspan="8" bgcolor="#99CCFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td width="85%" class="fontsize12"><div align="center"> <a href="serch.asp?pageno=1&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">首页</a> 
                      <a href="serch.asp?pageno=<%=pageno-5%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">前5页</a> 
                      <a href="serch.asp?pageno=<%=pageno-1%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">前页</a> 
                      第<font color="#FF0000"><strong><%=pageno%></strong></font>页 <a href="serch.asp?pageno=<%=pageno+1%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">后页</a> 
                      <a href="serch.asp?pageno=<%=pageno+5%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">后5页</a> 
                      <a href="serch.asp?pageno=<%=rs.pagecount%>&keyword=<%=keyword%>&sclass=<%=sclass%>" class="fontsize12wu" onMouseOver="window.status='';return true">尾页</a>  共<font color="#FF0000"><strong><%=rs.recordcount%></strong></font> 每页<font color="#FF0000"><strong><%=msgpagesize%></strong></font> 共<font color="#FF0000"><strong><%=rs.pagecount%></strong></font>页</div></td><td width="15%">
                  <form action="serch.asp?keyword=<%=keyword%>&sclass=<%=sclass%>" method="post" name="form1" class="fontsize12wu">
                    <div align="center">第 
                      <input name="pageno" type="text" class="inputtext" id="pageno" size="3">
                      <input name="Submit" type="submit" class="inputbox" value="Go">
                    </div></td>
                  </form>
                </tr>
              </table></td>
          </tr>
          <tr class="fontsize12"> 
            <td height="40" colspan="8" bgcolor="#99CCFF">图例说明:<img src="images/locktop.gif"> 
              被置顶的信息;<img src="images/file1.gif"> <a href="serch.asp?keyword=<%=user_name%>&sclass=发文者" class="fontsize12wu" onMouseOver="window.status='';return true">自己发送的信息</a>;<img src="images/file2.gif"> 
              <a href="serch.asp?keyword=<%=user_name%>&sclass=已看者" class="fontsize12wu" onMouseOver="window.status='';return true">已看过的信息;</a><img src="images/file3.gif"> 
              <a href="serch.asp?keyword=<%=user_name%>&looked=no" class="fontsize12wu" onMouseOver="window.status='';return true">未看的信息;</a><img src="images/cat.gif"> 
              有回复的信息;<img src="images/cat1.gif"> 无回复的信息。</td>
          </tr>
        </table>
        <table width="600" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="fontsize10"> </td>
          </tr>
        </table></td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
    <tr>
      <td height="40" bgcolor="#6699FF"><table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><form action="serch.asp" method="post" name="form2" class="fontsize14wu">
                <div align="center">搜索   关键词: 
                  <input name="keyword" type="text" class="inputtext" id="keyword">
                   类别: 
                  <select name="sclass" class="inputtext" id="sclass">
                    <option value="标题">主 题</option>
                    <option value="内容">内 容</option>
                    <option value="发文者">发送者</option>
                  </select>
                     
                  <input name="Submit2" type="submit" class="inputbox" value=" 搜索结果 ">
                </div>
              </form></td>
          </tr>
        </table></td>
    </tr>
  </table>
  <table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelr">
    <tr>
      <td class="fontsize04"> </td>
    </tr>
  </table>
  <table width="760" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><!--#include file="bottom.asp" --></td>
    </tr>
  </table>
</div>
</body>
</html>

⌨️ 快捷键说明

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