📄 link_admin.asp
字号:
<!--#include file="admin.asp"-->
<%
if request("delid")<>"" then
chk_admin_login(3)
sql="select * from links where id="&request("delid")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
response.redirect "link_admin.asp"
end if
if request("action")="add" then
chk_admin_login(1)
if request.form("name")="" or request.form("logo")="http://" or request.form("link")="http://" or request.form("link")="" then
response.write("<script language=""javascript"">alert(""错误:您的输入不正确!"");history.go(-1);</script>")
response.end
end if
sql="select * from links"
rs.open sql,conn,1,3
rs.addnew
rs("name")=request.form("name")
rs("logo")=request.form("logo")
rs("link")=request.form("link")
rs("time")=Now()
rs("pass")=True
rs.update
rs.close
set rs=nothing
response.redirect "link_admin.asp"
end if
if Request("passid")<>"" then
chk_admin_login(2)
sql="select * from links where id="&Request("passid")
rs.open sql,conn,1,3
rs("pass")=True
rs.update
rs.close
set rs=nothing
response.redirect "link_admin.asp"
end if
if Request("lockid")<>"" then
chk_admin_login(2)
sql="select * from links where id="&Request("lockid")
rs.open sql,conn,1,3
rs("pass")=False
rs.update
rs.close
set rs=nothing
response.redirect "link_admin.asp"
end if
%>
<script language=javascript>
function del()
{
if (confirm("真的要删除这条记录吗?删除后将无法恢复!"))
{
return true;
}
else
{
return false;
}
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<form method="post" action="?action=add">
<td> <table border="1" align="center" cellpadding="4" cellspacing="0" class="table-line">
<tr align="center">
<td colspan="2" class="td-title-color"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="shadow">增加链接</td>
</tr>
</table> </td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="right"> 网站名称:</td>
<td>
<input type="text" name="name" size="35"> </td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="right">logo地址:</td>
<td> <input name="logo" type="text" id="logo" size="40">
如使用文字链接,可不填</td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="right"> 连接地址:</td>
<td> <input type="text" name="link" size="40" value="http://"> </td>
</tr>
<tr align="center" bgcolor="#ffffff">
<td colspan="2"> <input type="submit" name="submit" value="确定"> </td>
</tr>
</table>
<p></p>
<table width="100%" border="1" cellpadding="4" cellspacing="0" class="table-line">
<tr class="td-title-color">
<td width="15%" height="25" align="center">网站名称</td>
<td width="25%" align="center">网站logo</td>
<td width="27%" align="center">加入时间</td>
<td width="10%" align="center">状态</td>
<td width="23%" align="center">操 作</td>
</tr>
<%
sql="select * from links"
rs.open sql,conn,1,1
do while not rs.eof
%>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="center"><a href="<%=rs("link")%>" target="_blank"><%=rs("name")%></a></td>
<td align="center">
<%if rs("logo")="" then
Response.Write "<a href="&rs("link")&" target=_blank title="&rs("name")&">"&rs("name")&"</a>"
else
Response.Write "<a href="&rs("link")&" target=_blank><img src="&rs("logo")&" width=88 height=31 border=0 alt="&rs("name")&" ></a>"
end if
%> </td>
<td align="center"><%=rs("time")%></td>
<td align="center"><%
select case rs("pass")
case "True"
Response.Write("正常")
case "False"
Response.Write("<b>待审核</b>")
end select
%>
</td>
<td align="center"><%
if rs("pass")=False then
Response.Write("<a href=?passid="&rs("id")&">审核</a>")
else
Response.Write("<a href=?lockid="&rs("id")&">锁定</a>")
end if
%> | <a href="link_edit.asp?id=<%=rs("id")%>">修改</a> | <a href="?delid=<%=rs("id")%>" onclick="return del();">删除</a></td>
</tr>
<%rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
</td>
</form>
</tr>
<tr>
<td height="22"> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -