📄 keyword.asp
字号:
<!--#include file="../setup.asp"-->
<!--#include file="login_admin.asp"-->
<%
'================================================================================
'Product:K-Search Version 2.1
'本“软件产品”受《中华人民共和国著作权法》和《中华人民共和国计算机软件保护条例》
'和国际条约的保护。如未经授权而擅自复制或传播本程序(或其中任何部分),将受到严厉
'的刑事及民事制裁,并将在法律许可的范围内受到最大可能的起诉!
'Homepage:http://www.lucoo.com/
'--------------------------------------------------------------------------------
'Copyright(c) 2005 lucoo.com All Rights Reserved 绿色互联 版权所有
'================================================================================
if session("rank")<>1 then
response.write "<Script>window.alert('您的管理员级别不能操作!');history.go(-1);</Script>"
response.end
end if
%>
<!--#include file="connstr.asp"-->
<%
keyword=request.querystring("keyword")
%>
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<script language=Javascript>
function checkall(all)
{
var a = document.getElementsByName("id");
for (var i=0; i<a.length; i++) a[i].checked = all.checked;
}
</script>
<script language="JavaScript">
function keyword_delete(id,page){
var id;
var page;
if (confirm("确定删除吗?")){
document.location.href="keyword_ok.asp?action=del&keyword=<%=keyword%>&id="+id+"&page="+page+"";
}
}
</script>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp"--><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="70" height="24" valign="bottom" bgcolor="#e1e1e1"> <table border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="60" height="23">关键词查询</td>
</tr>
</table></td>
<td bgcolor="#e1e1e1"><table border="0" cellpadding="0" cellspacing="0">
<form name="search" method="get" action="keyword.asp">
<tr>
<td width="150" align="center"><input name="keyword" type="text" id="keyword" value="<%=keyword%>"></td>
<td width="45"><input type="submit" value="查询"></td>
</tr>
</form>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<form name="form" method="get" action="keyword_ok.asp">
<tr>
<td> <%
dim rs
dim sql
dim count_sql
if keyword="" then
sql="order by id desc"
count_sql=""
else
sql="where keyword like '%" & keyword & "%' order by id desc"
count_sql="where keyword like '%" & keyword & "%'"
end if
dim keyword_count
set rs=conn.execute("select count(id) from keyword "&count_sql)
if rs.eof or rs.bof Then
keyword_count=0
else
keyword_count=rs(0)
end If
rs.close
set rs = nothing
set rs=server.createobject("adodb.recordset")
rs.open "select * from keyword "&sql,conn,1,1
if rs.eof and rs.bof then
'
else
dim totalPut
dim CurrentPage
dim TotalPages
Const MaxPerPage=30
if Not isempty(Request.QueryString("page")) then
currentPage=Cint(Request.QueryString("page"))
else
currentPage=1
end if
totalPut=keyword_count
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,"keyword.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpage totalput,MaxPerPage,"keyword.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"keyword.asp"
end if
end if
end if
sub showContent
for i=1 to 30 step 1
%>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="250" bgcolor="#FFFFFF"> <%if not rs.eof then%>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="225" height="25"> <input name="id" type="checkbox" id="id" value="<%=rs("id")%>">
<b><%=rs("keyword")%></b> [<a href="javascript:keyword_delete(<%=rs("id")%>,<%=CurrentPage%>)">删除</a>]</td>
</tr>
<tr>
<td height="25">搜索次数:<%=rs("hot")%> <a href="keyword.asp?keyword=<%=rs("keyword")%>">相关搜索</a></td>
</tr>
</table>
<%
rs.movenext
end if
%>
</td>
<td width="250" bgcolor="#FFFFFF"><%if not rs.eof then%>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="225" height="25"> <input name="id" type="checkbox" id="id" value="<%=rs("id")%>">
<b><%=rs("keyword")%></b> [<a href="javascript:keyword_delete(<%=rs("id")%>,<%=CurrentPage%>)">删除</a>]</td>
</tr>
<tr>
<td height="25">搜索次数:<%=rs("hot")%> <a href="keyword.asp?keyword=<%=rs("keyword")%>">相关搜索</a></td>
</tr>
</table>
<%
rs.movenext
end if
%>
</td>
<td width="250" bgcolor="#FFFFFF"><%if not rs.eof then%>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="225" height="25"> <input name="id" type="checkbox" id="id" value="<%=rs("id")%>">
<b><%=rs("keyword")%></b> [<a href="javascript:keyword_delete(<%=rs("id")%>,<%=CurrentPage%>)">删除</a>]</td>
</tr>
<tr>
<td height="25">搜索次数:<%=rs("hot")%> <a href="keyword.asp?keyword=<%=rs("keyword")%>">相关搜索</a></td>
</tr>
</table>
<%
rs.movenext
end if
%>
</td>
</tr>
</table>
<%
next
rs.close
set rs = nothing
conn.close
set conn=nothing
%>
<br> <table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td align="center">
<%
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
%>
<%If CurrentPage<2 Then %>
第一页 上一页
<%Else%>
<a href="<%=filename%>?keyword=<%=keyword%>&page=1">第一页</a>
<a href="<%=filename%>?keyword=<%=keyword%>&page=<%=CurrentPage-1%>">上一页</a>
<%End If%>
<%If n-currentpage<1 Then%>
下一页 最后一页
<%Else%>
<a href="<%=filename%>?keyword=<%=keyword%>&page=<%=CurrentPage+1%>">下一页</a>
<a href="<%=filename%>?keyword=<%=keyword%>&page=<%=n%>">最后一页</a>
<%End If%>
共<%=totalnumber%>个关键词 页次:<%=CurrentPage%>/<%=n%>页</td>
</tr>
</table>
<%
End Function
%>
</td>
</tr>
<tr>
<td height="20"><input name="checkbox" type="checkbox" onclick="checkall(this)">
全选
<input type="submit" value="删除">
<input name="keyword" type="hidden" id="keyword" value="<%=keyword%>">
<input name="page" type="hidden" id="page" value="<%=CurrentPage%>">
<input name="action" type="hidden" id="action" value="alldel">
</td>
</tr>
</form>
</table>
<!--#include file="bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -