📄 admin_ad.asp
字号:
<!--#include file="../inc/conn.asp"-->
<!--#include file="admin_popedom.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/css.css" rel="stylesheet" type="text/css">
<title>『驴友俱乐部』网站管理系统</title>
<style type="text/css">
<!--
body {
background-color: #efe8d7;
margin-left: 15px;
}
-->
</style>
</head>
<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))'本地路径
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))'服务器路径
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"
response.write "<tr><td style='font:9pt Verdana'>"
response.write "你提交的路径有误,禁止从站点外部提交数据请不要乱该参数!"
response.write "</td></tr></table></center>"
response.end
end if
action=trim(request("action"))
select case action
case "add"
call adadd()
case "edit"
call adedit()
case "del"
call addel()
case "view"
call adview()
end select
%>
<%sub adadd()
G_adname=trim(Request("G_adname"))
G_adinfo=trim(Request("G_adinfo"))
G_adurl=trim(Request("G_adurl"))
G_adpic=trim(Request("upimg"))
If G_adname="" Then
response.write "SORRY <br>"
response.write "<a href=""javascript:history.go(-1)"">网站名称不能为空,请返回重输</a>"
response.end
end if
If G_adurl="" Then
response.write "SORRY <br>"
response.write "<a href=""javascript:history.go(-1)"">网址不能为空,请返回重输</a>"
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from [G_guangao]"
rs.open sql,conn,1,3
rs.addnew
rs("G_adname")=G_adname
rs("G_adurl")=G_adurl
rs("G_adinfo")=G_adinfo
rs("G_adpic")=G_adpic
rs("G_adbegin")=now()
rs("G_adend")=now()
rs.update
rs.close
set rs=nothing
response.redirect "admin_webad.asp"
end sub
sub adedit()
id=trim(Request("id"))
G_adname=trim(Request("G_adname"))
G_adinfo=trim(Request("G_adinfo"))
G_adurl=trim(Request("G_adurl"))
G_adpic=trim(Request("upimg"))
If G_adname="" Then
response.write "SORRY <br>"
response.write "<a href=""javascript:history.go(-1)"">网站名称不能为空,请返回重输</a>"
response.end
end if
If G_adurl="" Then
response.write "SORRY <br>"
response.write "<a href=""javascript:history.go(-1)"">网址不能为空,请返回重输</a>"
response.end
end if
If id<>"" Then
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from [G_guangao] where G_adid="&id
rs.open sql,conn,1,3
rs("G_adname")=G_adname
rs("G_adurl")=G_adurl
rs("G_adinfo")=G_adinfo
rs("G_adpic")=G_adpic
rs("G_config")=1
rs.update
rs.close
set rs=nothing
end if
response.redirect "admin_webad.asp"
end sub
sub adview()
id =trim(Request.QueryString("id"))
view=trim(request("view"))
if id<>"" then
select case view
case 1
Set viewsql = conn.execute("update [G_guangao] set G_config=1 Where G_adid="&id)
Set viewsql = Nothing
case 0
Set viewsql = conn.execute("update [G_guangao] set G_config=0 Where G_adid="&id)
Set viewsql = Nothing
end select
end if
response.redirect "admin_webad.asp"
End sub
sub addel()
id =trim(Request.QueryString("id"))
if id<>"" then
Set del = conn.execute("Delete From [G_guangao] Where G_adid="&id)
Set del = Nothing
end if
response.redirect "admin_webad.asp"
End sub
sub adeditform()
id=trim(request.QueryString("id"))
if id<>"" then
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from [G_guangao] where G_adid="&id
rs.open sql,conn,1,1
%>
<form name="form1" method="post" action="admin_ad.asp?action=edit">
<table width="760" border="1" cellspacing="0" cellpadding="0">
<tr align="center">
<td width="100">网站名称:</td>
<td width="200"><input name="G_adname" type="text" value="<%=rs("G_adname")%>" id="G_adname" size="40" maxlength="20"></td>
<td width="104">网站说明</td>
<td width="356"><input name="G_adinfo" type="text" value="<%=rs("G_adinfo")%>" id="G_adinfo" size="80" maxlength="50"></td>
</tr>
<tr bgcolor="#c89f7b">
<td height="1" colspan="4" align="center"><!--表格高度1象素--></td>
</tr>
<tr align="center">
<td width="100">网站网址:</td>
<td width="200"><input name="G_adurl" type="text" id="G_adurl" value="<%=rs("G_adurl")%>" size="50" maxlength="50"></td>
<td width="104">网站图片</td>
<td width="356"><iframe name=upwin src="upload.asp?action=web"
frameborder=0 width=300 height=30></iframe><br><img src="../webimg/<%=rs("G_adpic")%>" width="120" height="60">
<INPUT id=upimg type=hidden
name=upimg value="<%=rs("G_adpic")%>"></td>
</tr>
<tr bgcolor="#c89f7b">
<td height="1" colspan="4" align="center"><!--表格高度1象素--></td>
</tr>
<tr align="center"> <INPUT id=id name="id" type=hidden value="<%=rs("G_adid")%>">
<td colspan="4"><input type="submit" name="Submit" value="修改广告"></td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
else
response.Redirect "admin_webad.asp"
end if
end sub
sub adaddform()
%>
<form name="form1" method="post" action="admin_ad.asp?action=add">
<table width="760" border="1" cellspacing="0" cellpadding="0">
<tr align="center">
<td width="100">网站名称:</td>
<td width="200"><input name="G_adname" type="text" id="G_adname" size="40" maxlength="20"></td>
<td width="104">网站说明</td>
<td width="356"><input name="G_adinfo" type="text" id="G_adinfo" size="80" maxlength="50"></td>
</tr>
<tr bgcolor="#c89f7b">
<td height="1" colspan="4" align="center"><!--表格高度1象素--></td>
</tr>
<tr align="center">
<td width="100">网站网址:</td>
<td width="200"><input name="G_adurl" type="text" id="G_adurl" value="http://" size="50" maxlength="50"></td>
<td width="104">网站图片</td>
<td width="356"><iframe name=upwin src="upload.asp?action=web"
frameborder=0 width=300 height=30></iframe>
<INPUT id=upimg type=hidden
name=upimg value=""></td>
</tr>
<tr bgcolor="#c89f7b">
<td height="1" colspan="4" align="center"><!--表格高度1象素--></td>
</tr>
<tr align="center">
<td colspan="4"><input type="submit" name="Submit" value="添加广告"></td>
</tr>
</table>
</form>
<%
end sub
%>
<body><div align="center">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table cellSpacing=0 borderColorDark=#ffffff cellPadding=0 width="780" align=center borderColorLight=#c89f7b border=1>
<tr>
<td height="30" align="center"><font color="#FF0000">『驴友俱乐部』</font>黄金广告管理</td>
</tr>
<tr>
<td height="30" align="center"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<%edit=trim(request("edit"))
if edit="yes" then
call adeditform()
else
call adaddform()
end if
%></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"><!--管理员列表开始--><%set rs=server.CreateObject("adodb.recordset")
sql="select * from [G_guangao] order by G_adid desc"
rs.open sql,conn,1,1%>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<%row_count=1 %>
<tr align="center"><%if rs.eof and rs.bof then
response.write "暂时没有分类!"
else
Do While Not rs.EOF%>
<td width="760" align="left"><table width="380" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td height="24" align="center"><img src="../webimg/<%=rs("G_adpic")%>" width="120" height="60"></td>
<td width="35" height="24" align="center"><a href="admin_ad.asp?edit=yes&id=<%=rs("G_adid")%>">修改</a></td>
<td width="35" height="24" align="center"><%if rs("G_config")=1 then%><a href="admin_ad.asp?action=view&id=<%=rs("G_adid")%>&view=0">隐藏</a><%else%><a href="admin_ad.asp?action=view&id=<%=rs("G_adid")%>&view=1">显示</a><%end if%></td>
<td width="35" height="24" align="center"><a href="admin_ad.asp?action=del&id=<%=rs("G_adid")%>" onClick="{if(confirm('真的要删除吗?')){return true;}return false;}" alt="删除该分类">删除</a></td>
</tr>
<tr bgcolor="#c89f7b">
<td height="1" colspan="4" align="center"><!--表格高度1象素--></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="1" colspan="4" align="center"><!--表格高度1象--></td>
</tr>
</table></td>
<% if row_count mod 2 =0 then%>
</tr><%end if
rs.MoveNext
row_count=row_count+1
Loop
rs.close
set rs=nothing
end if%>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="24"> </td>
</tr>
</table><!--管理员列表结束--></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -