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

📄 adminlinks.asp

📁 日记本(多用户版)V3.0 主要功能: 1、日记本基本功能:添加、修改日记等。 2、日记加密:当日记添加时
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%'##检查cookies中的密码,错误返回
'=========================================================
' 随然日记本(多用户版) Version:3.0
' Date: 2004-11-15
' Script Written by 随然(dampure)
' 随然日记本演示地址:http://www.suiran.cn
'=========================================================
' Copyright (C) 2003,2004 真露无香. All rights reserved.
' Web: www.yongzi.com
' Diary:http://www.suiran.cn
'=========================================================

pwd=Session("pwd")
user=Session("admindiary")
set rsadm=server.createobject("adodb.recordset")
sqladm="select * from superadmin where user='"&user&"'"
rsadm.open sqladm,conn,1,1
if pwd<>rsadm("pwd") or user<>rsadm("user") then
  response.redirect "admlogin.asp"
end if
set rsu=server.CreateObject("ADODB.RecordSet")
rsu.open "select * from superadmin",conn,1,3
response.cookies("pwd")=rsu("pwd")
'###检查结束
%>
<html>
<head>
<title>随然日记本——链接管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function yesok(){
if (confirm("确认要执行此操作吗?"))
		return true;
	else
		return false;
}

</script>
<%
   dim MaxPerPage
   dim sql 
   dim rs
   dim gstBookID
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j
   
      se=request("se")

   if not isEmpty(request("pl")) then
	pl=request("pl")
   else
	pl="userid"
   end if
   
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
%>
<style type="text/css">
td        { font-size: 9pt; line-height: 12pt}
a:link    {color: #0080FF; text-decoration: none }
a:visited {color: #0080FF; text-decoration: none }
a:hover   {color: #ee9c00; text-decoration: underline }
</style>
</head>

<body topmargin="0" background="image/bg.jpg">
<!--#include file="admintop.asp"-->
<%
set rs=server.createobject("adodb.recordset")
if request.form("se")="" and request("se")="" then 
sql="select * from diary order by userid desc" 
   else    
      if pl="user" then
         sql="select * from diary where userid in (select userid from admin where user like '%"&se&"%') order by userid desc"   
      elseif pl="diary" then
         sql="select * from diary where userid in (select userid from admin where title like '%"&se&"%') order by userid desc"  
      else
         sql="select * from diary where "&pl&" like '%"&se&"%' order by userid desc"  
      end if
end if  
rs.open sql,conn,1,1  

if rs.eof and rs.bof then %>  
<p align="center">没有或没找到任何记录!</p>
<% else
   rs.pagesize=20
   totalPut=rs.recordcount '记录总数
   totalPage=rs.pagecount
   MaxPerPage=rs.pagesize
      if currentpage<1 then
          currentpage=1
      end if
      if currentpage>totalPage then
          currentpage=totalPage
      end if
   if currentPage=1 then
         showpages
         showContent
         showpages

    else
         if (currentPage-1)*MaxPerPage<totalPut then
         rs.move  (currentPage-1)*MaxPerPage
         dim bookmark
         bookmark=rs.bookmark '移动到开始显示的记录位置
         showpages
         showContent
         showpages
     end if
   end if

end if
  

sub showContent
    dim i
    dim k
    k=(totalPut-MaxPerPage*(currentPage-1))+1
    i=0
%>
<table border=0 width=700 cellspacing="0" cellpadding="0" align=center>
<tr>
<td height=23 width=100 background="image/top_left.gif">
</td>
<td height=23 width=500 background="image/top_center.gif">
</td>
<td height=23 width=100 background="image/top_right.gif">
</td>
</tr>
</table>
<table style="BORDER-TOP: #8ca5b5 1px solid" cellSpacing=0 width="700" align=center bgColor=#eff7ff border=0>
  <tr>
    <td width="10%"   style="BORDER-RIGHT: #8ca5b5 1px solid; BORDER-LEFT: #8ca5b5 1px solid; BORDER-BOTTOM: #8ca5b5 1px solid" align=middle bgColor=#dbeaf5><FONT class=s color=#104a7b><B>用户名</B></FONT>
    </td>
    <td width="20%"  style="BORDER-RIGHT: #8ca5b5 1px solid; BORDER-LEFT: #8ca5b5 1px solid; BORDER-BOTTOM: #8ca5b5 1px solid" align=middle bgColor=#dbeaf5><FONT class=s color=#104a7b><B>名称</B></FONT>
    </td>
    <td width="35%"  style="BORDER-RIGHT: #8ca5b5 1px solid; BORDER-LEFT: #8ca5b5 1px solid; BORDER-BOTTOM: #8ca5b5 1px solid" align=middle bgColor=#dbeaf5><FONT class=s color=#104a7b><B>题目</B></FONT></td>
    <TD width="15%"  style="BORDER-RIGHT: #8ca5b5 1px solid; BORDER-LEFT: #8ca5b5 1px solid; BORDER-BOTTOM: #8ca5b5 1px solid" align=middle bgColor=#dbeaf5><FONT class=s color=#104a7b><B>长度</B></FONT></TD>
    <td width="10%"  style="BORDER-RIGHT: #8ca5b5 1px solid; BORDER-LEFT: #8ca5b5 1px solid; BORDER-BOTTOM: #8ca5b5 1px solid" align=middle bgColor=#dbeaf5><FONT class=s color=#104a7b><B>修改</B></FONT></td>
    <td width="10%"  style="BORDER-RIGHT: #8ca5b5 1px solid; BORDER-LEFT: #8ca5b5 1px solid; BORDER-BOTTOM: #8ca5b5 1px solid" align=middle bgColor=#dbeaf5><FONT class=s color=#104a7b><B>删除</B></FONT></td>
  </tr>
<%do while not (rs.eof or err)
         k=k-1


set rs1=server.createobject("adodb.recordset")
sql="select * from admin where userid="& rs("userid") 
rs1.open sql,conn,1,1  
usrname=rs1("user")
diary=rs1("title")
rs1.close

    if len(rs("title"))>20 then
       title=left(rs("title"),20)&"......"
    else
       title=rs("title")
    end if
%>

  <tr>
    <td width="5%" style="BORDER-BOTTOM: #8ca5b5 1px solid" align=middle><%=usrname%></td>
      <td width="10%" style="BORDER-BOTTOM: #8ca5b5 1px solid" align=middle><a href="../diary.asp?user=<%=usrname%>" target="_blank"><%=diary%></td>
    <td style="BORDER-BOTTOM: #8ca5b5 1px solid" align=left><a href="../show_diary.asp?id=<%=rs("id")%>" target="_blank"><%=title%></a><%if rs("lock")=0 then response.Write "<IMG src=../images/lock.gif border=0>" %>
                        </FONT></TD></td>
    <TD style="BORDER-BOTTOM: #8ca5b5 1px solid" align=right><%=rs.fields("content").actualsize/2%>字</TD>
    <TD style="BORDER-BOTTOM: #8ca5b5 1px solid" align=middle>
    <%if rs("best")=1 then%>
    <A 
      href="adminedit.asp?id=<%=rs("id")%>&best=0" onclick='return yesok()' target="_blank"><font color=red>优</font></A>
    <%else%>
    <A 
      href="adminedit.asp?id=<%=rs("id")%>&best=1" target="_blank"><IMG 
      alt=设置为优秀日记 src="image/edit.gif" border=0></A>
    <%end if%>
      </TD>
    <td style="BORDER-BOTTOM: #8ca5b5 1px solid" align=middle><a href="admlinkdel.asp?id=<%=rs("id")%>&page=<%=request("page")%>"><IMG alt=删除 src="image/del.gif" border=0></a></td>
  </tr>

<%
    i=i+1
    if i>=MaxPerPage then exit do '循环时如果到尾部则先退出,如果记录达到页最大显示数,也退出
       rs.movenext
    loop
   end sub 

sub showpages()
dim n
n=totalPage
%>
</table>
<table border=0 width=700 cellspacing="0" cellpadding="0" align=center>
<tr>
<td height=23 width=100 background="image/bottom_left.gif">
</td>
<td height=23 width=500 background="image/bottom_center.gif">
</td>
<td height=23 width=100 background="image/bottom_right.gif">
</td>
</tr>
</table>


<form Action="manage.asp" Method="GET" align="right">
  <div align="center"><center>
      <table border="0" width="100%" cellspacing="0" cellpadding="0" height="30">
        <tr>
          <td width="100%" height="30"> 
            <p align="center"><%   
   If currentPage <> 1 Then  
      Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&">[第一页]</A> "  
      Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & (currentPage-1) & ">[上一页]</A> "  
   End If  
   If currentPage <> rs.PageCount Then  
      Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & (currentPage+1) & ">[下一页]</A> "  
      Response.Write "<A HREF="&filename&"?pl="&pl&"&se="&se&"&Page=" & totalPage & ">[最后一页]</A> "  
   End If  
%><%if se<>"" then%>查找<b><font color="#FF0000"><%=se%></font></b><%end if%> 共找到<font color="#FF0000"><%=totalPut%></font>条记录,第<%=currentPage%>页,共<%=totalPage%>页     
条转到:第<Select  name="go" onChange="window.location=form.go.options[form.go.selectedIndex].value" size="1" class=smallselsect style='BACKGROUND-COLOR:#ffffff;font-family: 宋体; font-size: 9pt;'>    
<%for i=1 to n      
   response.write "<option value="&filename&"?pl="&pl&"&se="&se&"&page="& i       
   if currentpage=i then       
     response.write " selected"      
   end if      
   response.write ">"& i &"</option>"      
next      
  response.write "</select>页"   
%>   
            </select> 
          </td>  
    </tr>  
  </table>  
  </center></div>  
</form>  
<%  
end sub  
%>   
<form name="searchtitle" method="POST" action="adminlinks.asp">    
<div align="center"> 
  <center>   
<table border="0" width="160" cellspacing="1" cellpadding="2" bgcolor="#0080FF">   
  <tr>   
    <td width="100%" bgcolor="#FFFFFF">   
<p align="center">   
输入您要搜索的字符<br>   
<input type="text" name="se" size="17">   
<select name="pl" size="1">   
<option value="user">用户</option> 
<option value="diary">名称</option> 
<option value="title">日记题目</option>   
   
        </select>   
        <input type="submit" value="查询" name="title">   
    </td>   
  </tr>   
</table></center> 
</div> 
</form> 
</body>  
</html>  
 <%rsadm.close 
set rsadm=nothing 
rs.close 
set rs=nothing    
conn.close 
set conn=nothing %>

⌨️ 快捷键说明

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