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

📄 admin_advertise.asp

📁 玛雅自助导航系统 玛雅自助导航系统 玛雅自助导航系统
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Conn.asp"-->
<%
If Session(SiteSN&"_Admin_Login")<>AdminName&"_"&AdminPass Then
   Response.redirect "Admin_Login.asp"
End If

dim Action
Action=Request.QueryString("Action")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="style.css" rel="stylesheet" type="text/css">
<title>管理网站信息_<%=WebName & ChannelName%></title>
<Script Language="javascript">
<!--
function SetLogoArea(Value)
{   document.all.LinkArea.style.display=Value;}
//-->
</Script>
</head>
<body>
<div class="main_title1">
<a href="admin_manage.asp">管理首页</a> | <a href="Admin_Advertise.asp?Action=showlist">增加WAP广告</a> | <a href="Admin_Advertise.asp">管理WAP广告</a> | <a href="admin_login.asp?action=exit">退出管理</a>
</div>
<div class="mainbar">
  <%
select case Action
case "edit"
	call edit
case "edit1"
	call edit1
case "saveedit"
    call saveedit
case "showlist"
    call showlist
case "ShowLog"
	call ShowLog
case "del"
	call dellink
case else
	call ListSite
end select
%>
</div>

<%
sub ListSite
dim MaxPageSize:MaxPageSize=5 '每页显示的记录数
'分页信息
dim PageNo
PageNo=Request.QueryString("PageNo")
if PageNo="" or not Isnumeric(PageNo) then
PageNo=1
else
PageNo=int(PageNo)
end if

sql="select * from Advertise order by id desc"


%>
<div style="text-align:center;">
<div class="cutpage">      
<%Wap.showPageInfo "Advertise","id","",PageNo,MaxPageSize,""%>
</div>
</div>
<%
set rs=server.createobject("adodb.recordset")
rs.open sql,Conn,1,1

if not rs.eof then
	rs.PageSize = MaxPageSize
	rs.AbsolutePage = PageNo 
	dim i
	i=0   
%>
<table border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <tr align="center" class="main_title1"> 
    <td width="60"> 广告ID</td>
    <td width="160">广告名称</td>
    <td width="50">显示类别</td>
    <td width="110">加入时间</td>
    <td width="110">最新显示</td>
    <td width="110">最新点击</td>
    <td width="100">管理选项</td>
  </tr>
  <%Do While Not rs.EOF and i<MaxPageSize%>
  <tr align="center"> 
    <td><font color="#FF0000"><%=rs("id")%></font></td>
    <td>
	<%if rs("act")=0 then%>
	     <font color="#FF0000">[暂停]<%=rs("sitename")%></font>
    <%ElseIf rs("act")=1 then%>
         <%=rs("siteName")%>
    <%ElseIf rs("act")=2 then%>
         <font color="#FF0000">[过期]<%=rs("sitename")%></font>
    <%end if%>    </td>
    <td>
	<%if rs("xslei")="txt" then Response.write "纯文本"%>
    <%if rs("xslei")="gif" then Response.write "GIF图片"%>    </td>
    <td><%=rs("time")%></td>
    <td><%=rs("lasttime")%></td>
    <td><%=rs("regtime")%></td>
    <td>    <a href="?Action=showlist&id=<%=rs("id")%>&PageNo="&cstr(PageNo)&"">修改</a>
    <%if rs("act")=1 then 
	     Response.write "<font color='#0000ff'><a href=""?id="&rs("id")&"&action=edit1&PageNo="&cstr(PageNo)&"""><font color='#0000ff'>暂停</font></a></font>"           
	else   
		 Response.write "<a href=""?id="&rs("id")&"&action=edit&PageNo="&cstr(PageNo)&"""><font color='#FF0000'>激活</font></a>"
    end if%>
    <a href="?Action=del&id=<%=rs("id")%>&PageNo="&cstr(PageNo)&"" onClick="return confirm('确定要删除吗?')">删除</a></td>
  </tr>
  <%if rs("xslei")="txt" then%>
  <tr> 
    <td align="center"> 链接URL</td>
    <td colspan="6"><%=rs("url")%></td>
  </tr>
  <%end if%>
  <%if rs("xslei")="gif" then%>
  <tr> 
    <td align="center"> 链接URL</td>
    <td colspan="3"><%=rs("url")%></td>
    <td align="center">图片URL</td>
    <td colspan="2"><%=rs("gif_url") %></td>
  </tr>
  <%end if%>
  <tr> 
    <td align="center"> 简介/内容</td>
    <td colspan="6">
	<%if rs("intro")="" then
	   Response.write "无"
    else
       Response.write rs("intro")
    end if%>    </td>
  </tr>
  <tr> 
    <td align="center">调用代码</td>
    <td colspan="6"><textarea name="textarea" style="width:90%;height:15px;"><a href="<%=WapUrl&WapMulu%>Wap_Ads.asp?ID=<%=Rs("ID")%>"><%=Trim(Rs("sitename"))%></a></textarea></td>
  </tr>
    <tr> 
    <td align="center" bgcolor="#FDF0F9">贡献统计</td>
    <td colspan="3" bgcolor="#FDF0F9">显示次数:<%=rs("show") %>点击次数: <%=rs("click")%></td>
    <td align="center" bgcolor="#FDF0F9">失效条件</td>
    <td colspan="2" bgcolor="#FDF0F9">
    <%
if rs("class")=1 then
%>
              点击<font color=red><%=rs("clicks")%></font>次 
              <%
elseif rs("class")=2 then
%>
              显示<font color=red><%=rs("shows")%></font>次 
              <%
elseif rs("class")=3 then
%>
              截止期<font color=red><%=rs("lasttime")%></font> 
              <%
elseif rs("class")=4 then
%>
              点击<font color=red><%=rs("clicks")%></font>次,显示<font color=red><%=rs("shows")%></font>次 
              <%
elseif rs("class")=5 then
%>
              点击<font color=red><%=rs("clicks")%></font>次,截止期<font color=red><%=rs("lasttime")%></font> 
              <%
elseif rs("class")=6 then
%>
              显示<font color=red><%=rs("shows")%></font>次,截止期<font color=red><%=rs("lasttime")%></font> 
              <%
elseif rs("class")=7 then
%>
              点击<font color=red><%=rs("clicks")%></font>次,显示<font color=red><%=rs("shows")%></font>次,截止期<font color=red><%=rs("lasttime")%></font> 
              <%
else
%>
              无限制条件 
<%
end if
%>    </td>
  </tr>

  <tr> 
    <td height="5" colspan="7" bgcolor="#8cc3de"></td>
  </tr>
  <%  
i=i+1  
rs.MoveNext  
Loop  
else
%>
  <tr> 
    <td height="80" colspan="7" align="center"><B>没有网站广告</B></td>
  </tr>
  <%
end if  
rs.close
set rs=nothing

%>
</table>
<%end sub


sub ShowLog
	dim rs,sql
	dim inout
	dim username
	dim strtitle
	
	dim MaxPageSize:MaxPageSize=30 '每页显示的记录数
	
	id=Request.QueryString("id")
	ips=Request.QueryString("ips")
	if ips="1" then
		strtitle="ID为 "&id&" 的广告条点击记录"
	elseif ips="2" then
		strtitle="ID为 "&id&" 的广告条显示记录"
	end if
	
	dim PageNo
	PageNo=Request.QueryString("PageNo")
	if PageNo="" or not Isnumeric(PageNo) then
		PageNo=1
	else
		PageNo=int(PageNo)
	end if

%>
<p align="center"><%=strtitle%></p>

<table width="49%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
  <tr align="center" class="tr2"> 
    <td width="392">记录ID</td>
    <td width="339">IP地址</td>
    <td width="299">时间</td>
  </tr>
  <%
	set rs=server.createobject("adodb.recordset")
	sql="select * from Adiplist order by id desc"
	rs.open sql,Conn,1,1
	if rs.eof then
		Response.write "<tr><td colspan=""3"" align=""center"" class=""tr2"">暂时还没有记录</td></tr>"
	else
		rs.PageSize = MaxPageSize
		rs.AbsolutePage = PageNo 
		dim i
		i=0   
		do while not rs.eof and i<MaxPageSize
	%>
  <tr class="tr2">
    <td><%=rs("id")%></td>
    <td><%=rs("ip")%></td>
    <td><%=rs("time")%></td>
  </tr>
  <%
		i=i+1
		rs.movenext
		loop
	end if
	set rs=nothing%>
</table>
<div class="cutpage">
<%Wap.showPageInfo "Adiplist","id","",PageNo,MaxPageSize,""%>
</div>
<%
Call GoBack
end sub


sub dellink
	dim id
	id=Request("id")
	Wap.execute("delete from Advertise where id="&id&"")
	Response.write "<script language=JavaScript>" & chr(13) & "alert('广告ID名为"&ID&"的广告删除成功!');" &"window.location='Admin_Advertise.asp?action=ListSite&PageNo="&Request("PageNo")&"'" & "</script>"
end sub


sub showlist
	dim rs
	id=Request("id")
	if id<>"" then
	set rs=server.createobject("adodb.recordset")
	sql="select * from Advertise where id="&id&""
	rs.open sql,Conn,1,1
	if not rs.eof then
	   sitename=rs("sitename")
	   url=rs("url")
	   intro=rs("intro")
	   xslei=rs("xslei")
	   gif_url=rs("gif_url")
	   classs=rs("class")
	   lasttime=rs("lasttime")
	   strtitle="修改广告ID"&id
	end if
	else
	   id="0"
	   sitename=""
	   url="http://"
	   intro=""
	   xslei="txt"
	   gif_url="http://"
	   strtitle="添加广告"
	end if
	%>
    <p align="center"><%=strtitle%></p>
    <form action="?Action=saveedit" method="POST">
       <table width="85%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
          
<tr class="tr2"> 
            <td align="center">广告名称:</td>
            
            <td><input name="id" type="hidden" value="<%=id%>" ><input name="sitename" type="text" id="siteTitle" value="<%=sitename%>" size="30" maxlength="30">
              <font color="#CC0000">* 不能超过30个字符(15个汉字)</font></td>
          </tr>
 
          <tr class="tr2"> 
            <td align="center">链接URL:</td>
            <td><input name="url" type="text" id="siteurl" value="<%=url%>" size="50"></td>
         </tr>
                   <tr class="tr2"> 
            <td align="center">网站简介:</td>
            <td> <textarea name="intro" cols="50" rows="4" id="siteintro"><%=intro%></textarea>
              <br>
              <font color="#FF0000">*</font> <font color="#CC0000">不能超过200个字符(100个汉字)</font>            </td>
          </tr>
          
        <tr class="tr2"> 
            <td align="center">广告类型:</td>
            <td> 
             <input name="xslei" type="radio" onClick="SetLogoArea('')" value="gif"<%if xslei="gif" then Response.Write " checked"%>>
             GIF图片
             <input name="xslei" type="radio" onClick="SetLogoArea('none')" value="txt"<%if xslei="txt" then Response.Write " checked"%>>
             纯文本</td>
          </tr>
          
          <tr class="tr2" Style="display:none" ID="LinkArea"> 
            <td align="center">图片URL:</td>
            <td><input name="gif_url" type="text" id="siteurl" value="<%=gif_url%>" size="50"></td>
         </tr>
          <tr class="tr2"> 
            <td colspan="2" align="center" class="td"> <strong>在4个条件组中,任选其中一组,用于限制该广告自动进入休眠状态的条件,以后可随时修改</strong></td>
          </tr>


        <tr class="tr2"> 
          <td align="center"><font color=red>(1)</font></td>
            <td><input type=radio value=0 name=class<%if classs=0 then response.write " checked"%>>无限制循环</td>
         </tr>
          
          
          <tr class="tr2"> 
            <td align="center"><font color=red>(2)</font></td>
            <td><input type=radio value=1 name=class<%if classs=1 then response.write " checked"%>>点击数不超过<input type=text name=clicks1 class="upfile" size=8<%if classs=1 then response.write " value=""" & clicks &""""%>></td>
          </tr>
        <tr class="tr2"> 
          <td align="center"><font color=red>(3)</font></td>
            <td><input type=radio value=2 name=class<%if classs=2 then response.write " checked"%>>显示数不超过<input type=text name=shows2 class="upfile" size=8<%if classs=2 then response.write " value=""" & shows &""""%>></td>
         </tr>
        <tr class="tr2"> 
          <td align="center"><font color=red>(4)</font></td>
            <td><input type=radio value=3 name=class<%if classs=3 then response.write " checked"%>>显示截止期为<input type=text name=time3 class="upfile" size=20<%if classs=3 then response.write " value=""" & lasttime &""""%>><font color=#FF0000>格式为yyyy-mm-dd hh:mm:ss或者yyyy-mm-dd</font></td>
         </tr>

        <tr class="tr2"> 
            <td colspan="2" align="center" class="td"> <input type="submit" value=" 确 定 " name="yes"> 
              <input name="reset" type="reset"  
value=" 重 写 "> </td>
          </tr>
        </table>
</form>
<%end sub%> 
      <%
sub saveedit
id=Request.form("id")
sitename=Request.form("sitename")
url=Request.form("url")
intro=Request.form("intro")
xslei=Request.form("xslei")
getclass=Request.form("class")
gif_url=Request.form("gif_url")

if getclass=0 then
   gettime=now()
elseif getclass="1" then
   getshows=Request.form("clicks1")
   gettime=now()
elseif getclass="2" then
   getshows=Request.form("shows2")
   gettime=now()
elseif getclass="3" then
   gettime=Request.form("time3")
end if
 If id="0" Then
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from Advertise",Conn,1,2
	rs.AddNew
 Else
    set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from Advertise where id="&id&"",Conn,1,2
 End If
	rs("sitename")=sitename
	rs("url")=url
	rs("intro")=intro
	rs("xslei")=xslei
	rs("gif_url")=gif_url
	rs("act")=1
	rs("class") = getclass
	rs("shows") = getshows
	rs("time")=Now()
	rs("lasttime")=gettime
	rs("regtime")=Now()
	rs.Update
	
	rs.close
	set rs=nothing		
		
	If id="0" Then
	   Response.write "<p>广告增加成功</p>"
	   Response.write "<p><< <a href=""javascript:history.go(-1)"">返回上一页 </a> << <a href=""Admin_Advertise.asp"">返回广告列表</a> << <a href=""admin_manage.asp"">返回管理首页</a></p>"
	Else
	   Response.write "<p>广告修改成功</p>"
	   Response.write "<p><< <a href=""javascript:history.go(-1)"">返回上一页 </a> << <a href=""Admin_Advertise.asp"">返回广告列表</a> << <a href=""admin_manage.asp"">返回管理首页</a></p>"
	End If
end sub


sub edit
dim rs
id=Request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Advertise where id="&id&"",Conn,1,2
rs("act")="1"
rs.Update
response.write "<script language=JavaScript>" & chr(13) & "alert('广告ID"&ID&"暂停操作成功!');" &"window.location='Admin_Advertise.asp?action=ListSite&PageNo="&Request("PageNo")&"'" & "</script>"
rs.close:set rs=nothing
end sub

sub edit1
dim rs

id=Request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Advertise where id="&id&"",Conn,1,2
if not rs.eof then
rs("act")="0"
rs.Update
response.write "<script language=JavaScript>" & chr(13) & "alert('广告ID"&ID&"激活操作成功!');" &"window.location='Admin_Advertise.asp?action=ListSite&PageNo="&Request("PageNo")&"'" & "</script>"
rs.close:set rs=nothing
end if
end sub

Sub GoBack
	Response.Write "<p align=""center""><< <a href=""javascript:history.go(-1)"">返回上一页</a></p>"	
End Sub
%>

<!--#include file="under.asp"-->
<%set Wap=nothing%>

⌨️ 快捷键说明

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