📄 admin_adsmanage.asp
字号:
dim PicUrl
PicUrl=rs("PicUrl")
response.write"<a href='"&PicUrl&"' target=_blank><img src="&PicUrl&" width=130 height=30 border=0></a>"
case "flash"
response.write"Flash广告 <a href=# onclick=""javascript:open('?action=showflash&AdsID="&rs("AdsID")&"','','scrollbars=yes,width="&rs("Picwidth")+50&",height="&rs("Picheight")+100&"')"">预览和取得链接</a>"
end select
%> </td>
<td align="center">
<%
if rs("AdsState")=true then
response.write"<font color=green>正在播放</font>"
else
response.write"<font color=red>暂停播放</font>"
end if
%> </td>
<td align="center">
<%
if rs("AdsState")=true then%>
当前比例<input name="SProportion" type="text" class=form80 value="<%=rs("SProportion")%>" size="4">
<input type="hidden" name="AdsID" value="<%=rs("AdsID")%>">
<%else
response.write"N/A"
end if
%>
</td>
</tr>
<%
rs.movenext
wend
rs.close
set rs=nothing
%>
<tr bgcolor="#f6f6f6">
<td colspan=4 align="right">显示比例范围1-10
<input type="submit" value="修改" name="chk" class=button onclick="return modify()">
</td>
</tr>
</form>
</table>
<%
end sub
sub ads_Condition()
dim ShowState,ClickState,ShowCount,ClickCount
AdsCategoryID=request("AdsCategoryID")
ASProportion=0
if chk="修改" then
for i=1 to request("AdsID").count
if request("ShowState-"&request("AdsID")(i)&"")=1 and not isNumeric(request("ShowCount-"&request("AdsID")(i)&"")) then Call Succeed("true","请输入显示次数!","",""):response.end
if request("ClickState-"&request("AdsID")(i)&"")=1 and not isNumeric(request("ClickCount-"&request("AdsID")(i)&"")) then Call Succeed("true","请输入点击次数!","",""):response.end
next
for i=1 to request("AdsID").count
ShowState=request("ShowState-"&request("AdsID")(i)&"")
ClickState=request("ClickState-"&request("AdsID")(i)&"")
ShowCount=request("ShowCount-"&request("AdsID")(i)&"")
ClickCount=request("ClickCount-"&request("AdsID")(i)&"")
conn.execute("update Ads set ClickState="&ClickState&",ShowState="&ShowState&" where AdsID="&request("AdsID")(i))
if ClickState=1 then conn.execute("update Ads set ClickCount="&ClickCount&" where AdsID="&request("AdsID")(i))
if ShowState=1 then conn.execute("update Ads set ShowCount="&ShowCount&" where AdsID="&request("AdsID")(i))
if ShowState=0 then conn.execute("update Ads Set ShowCount=null where AdsID="&request("AdsID")(i))
if ClickState=0 then conn.execute("update Ads Set ClickCount=null where AdsID="&request("AdsID")(i))
next
end if
set rs=conn.execute("select * from Ads where AdsCategoryID="&AdsCategoryID&" order by AdsID desc")
call head_main()
%>
<table border=1 width='100%' cellspacing=0 cellpadding=1<%response.write table1%>>
<tr align="center">
<td>标题</td>
<td>条件设置</td>
</tr>
<form name=form1 method="post" action="?action=Condition&chk=修改&AdsCategoryID=<%=rs("AdsCategoryID")%>">
<%
while not rs.eof
%>
<tr <%response.write mtr%>>
<td> <a href="?action=Depict&AdsID=<%=rs("AdsID")%>&AdsCategoryID=<%=AdsCategoryID%>"><%=rs("AdsName")%></a></td>
<td align="center">
<input type="radio" name="ShowState-<%=rs("AdsID")%>" value="0" <%if rs("ShowState")=false or isnull(rs("ShowState")) then response.write"checked"%>>不限制显示次数
<input type="radio" name="ShowState-<%=rs("AdsID")%>" value="1" <%if rs("ShowState")=true then response.write"checked"%>>显示次数超过
<input name="ShowCount-<%=rs("AdsID")%>" type="text" size="3" class=form80 value="<%=rs("ShowCount")%>">后停止播放
<br>
<font color=green>
<input type="radio" name="ClickState-<%=rs("AdsID")%>" value="0" <%if rs("ClickState")=false or isnull(rs("ClickState")) then response.write"checked"%>>不限制点击次数
<input type="radio" name="ClickState-<%=rs("AdsID")%>" value="1" <%if rs("ClickState")=true then response.write"checked"%>>点击次数超过
<input name="ClickCount-<%=rs("AdsID")%>" type="text" size="3" class=form80 value="<%=rs("ClickCount")%>">后停止播放</font>
<input name="AdsID" type="hidden" value="<%=rs("AdsID")%>">
</td>
</tr>
<%
rs.movenext
wend
%>
<tr bgcolor="#f6f6f6">
<td colspan=2 align="right">
<input type="submit" value="修改" name="chk" class=button onclick="return modify()"> </td>
</tr>
</form>
</table>
<%
rs.close
set rs=nothing
end sub
sub ads_MD()
AdsCategoryID=request("AdsCategoryID")
if chk="删除" then
for i=1 to request("AdsID").count
conn.execute("delete from Ads where AdsID="&request("AdsID")(i))
next
end if
set rs=conn.execute("select * from Ads where AdsCategoryID="&AdsCategoryID&" order by AdsID desc")
call head_main()
%>
<table border=1 width='100%' cellspacing=0 cellpadding=1<%response.write table1%>>
<tr align="center">
<td>标题</td>
<td>备注</td>
<td>当前状态</td>
<td>操作类型</td>
</tr>
<%
while not rs.eof
%>
<form name=form1 method="post" action="?action=MD&chk=删除&AdsCategoryID=<%=rs("AdsCategoryID")%>">
<tr <%response.write mtr%>>
<td> <a href="?action=Depict&AdsID=<%=rs("AdsID")%>&AdsCategoryID=<%=AdsCategoryID%>"><%=rs("AdsName")%></a></td>
<td align="center"><%=rs("remark")%> </td>
<td align="center">
<%
if rs("AdsState")=true then
response.write"<font color=green>正在播放</font>"
else
response.write"<font color=red>暂停播放</font>"
end if
%> </td>
<td align="center"><a href="?action=Operation&AdsID=<%=rs("AdsID")%>&AdsCategoryID=<%=AdsCategoryID%>">修改</a>
<input type="checkbox" value="<%=rs("AdsID")%>" name="AdsID"> </td>
</tr>
<%
i=i+1
rs.movenext
wend
rs.close
set rs=nothing
%>
<tr bgcolor="#f6f6f6">
<td colspan=5 align="right"><input type="submit" value="删除" name="chk" onclick="return Del()" class=button>
选中所有
<input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="ON">
</td>
</tr>
</form>
</table>
<%
end sub
sub ads_Operation()
dim Stat,AdsName,AdsType,PicUrl,ObjUrl,PicHeight,PicWidth,Remark,AdsState
Stat=request("Stat")
AdsCategoryID=request("AdsCategoryID")
AdsID=request("AdsID")
AdsName=trim(request("AdsName"))
AdsType=trim(request("AdsType"))
PicUrl=trim(request("PicUrl"))
ObjUrl=trim(request("ObjUrl"))
PicHeight=request("PicHeight")
PicWidth=request("PicWidth")
Remark=request("Remark")
if chk="修改" then
set rs=server.createobject("adodb.recordset")
sql="select * from Ads where AdsID="&AdsID
rs.open sql,conn,3,3
rs("AdsName")=AdsName
rs("AdsType")=AdsType
rs("PicUrl")=PicUrl
rs("ObjUrl")=ObjUrl
rs("PicHeight")=PicHeight
rs("PicWidth")=PicWidth
rs("Remark")=Remark
rs.update
response.redirect"?action=MD&AdsCategoryID="&AdsCategoryID&""
elseif chk="添加" then
set rs=server.createobject("adodb.recordset")
sql="select * from Ads"
rs.open sql,conn,3,3
rs.addnew
rs("AdsName")=AdsName
rs("AdsCategoryID")=AdsCategoryID
rs("AdsType")=AdsType
rs("AdsState")=0
rs("PicUrl")=PicUrl
rs("ObjUrl")=ObjUrl
rs("PicHeight")=PicHeight
rs("PicWidth")=PicWidth
rs("Remark")=Remark
rs("CurrentSCount")=0
rs("InputDate")=Now()
rs.update
rs.close
set rs=nothing
response.redirect"?action=MD&AdsCategoryID="&AdsCategoryID&""
end if
if AdsID<>"" then
set rs=conn.execute("select * from Ads where AdsID="&AdsID&" order by AdsID desc")
if not rs.eof then
AdsName=rs("AdsName")
AdsType=rs("AdsType")
AdsState=rs("AdsState")
PicHeight=rs("PicHeight")
PicWidth=rs("PicWidth")
PicUrl=rs("PicUrl")
ObjUrl=rs("ObjUrl")
remark=rs("remark")
end if
end if
%>
<%if AdsID<>"" then%>
<table border=1 width='100%' cellspacing=0 cellpadding=1<%response.write table1%>>
<tr><td height="18" colspan="2" align="center" bgcolor=<%response.write color3%>><strong>修改广告</strong></td></tr>
<form name=form method="post" action="?action=Operation&chk=修改&AdsCategoryID=<%=rs("AdsCategoryID")%>&AdsID=<%=rs("AdsID")%>">
<%else%>
<table border=1 width='100%' cellspacing=0 cellpadding=1<%response.write table1%>>
<tr><td height="18" colspan="2" align="center" bgcolor=<%response.write color3%>><strong>添加广告</strong></td></tr>
<form name=form method="post" action="?action=Operation&chk=添加&AdsCategoryID=<%=AdsCategoryID%>">
<%end if%>
<tr>
<td width="50%"> 广告名称<br><font color=#c0c0c0>广告的简单说明</font></td>
<td><input type="text" class=form80 name="AdsName" value="<%=AdsName%>" size="20"></td>
</tr>
<tr>
<td> 广告类型<br><font color=#c0c0c0>请选择普通图片或Flash</font></td>
<td>
<input type="radio" name="AdsType" value="pic" <%if AdsType="pic" or AdsType="" then response.write"checked"%>>图片
<input type="radio" name="AdsType" value="flash" <%if AdsType="flash" then response.write"checked"%>>Flash
</td>
</tr>
<tr>
<td> 图片(Flash)长、宽<br><font color=#c0c0c0>此广告的图片长度、宽度</font></td>
<td>长:<input type="text" class=form80 size=5 name="PicHeight" value="<%=PicHeight%>" onblur="Isvalidity(PicHeight,'长')">
宽:<input type="text" class=form80 size=5 name="PicWidth" value="<%=PicWidth%>" onblur="Isvalidity(PicWidth,'宽')"></td>
</tr>
<tr>
<td> 图片(Flash)路径</td>
<td><input type="text" class=form80 name="PicUrl" size=30 value="<%if PicUrl="" then response.write"http://":else:response.write PicUrl%>"></td>
</tr>
<tr>
<td> 目标广告联接</td>
<td>
<input type="text" class=form80 name="ObjUrl" size=30 value="<%if ObjUrl="" then response.write"http://":else:response.write ObjUrl%>">
</td>
</tr>
<tr>
<td> 备注</td>
<td><textarea name=remark rows=5 cols=30><%=remark%></textarea></td>
</tr>
<tr align="center" bgcolor="#f6f6f6">
<td colspan="2">
<%if AdsID<>"" then %>
<input type="submit" class=button value="修改" name=chk onclick="return CheckAds()">
<input type="reset" class=button value="还原">
<input type="button" class=button value="返回" onclick="javascript:history.back()">
<%else%>
<input type="submit" class=button value="添加" name=chk onclick="return CheckAds()">
<input type="reset" class=button value="还原">
<input type="button" class=button value="返回" onclick="javascript:history.back()">
<%end if%>
</td>
</tr>
</form>
</table>
<%
end sub
sub show_adflash()
dim PicUrl,PicHeight,PicWidth
AdsID=request("AdsID")
set rs=conn.execute("select PicUrl,PicHeight,PicWidth From Ads where AdsID="&AdsID)
if rs.eof then response.end
PicUrl=rs("PicUrl")
PicHeight=rs("PicHeight")
PicWidth=rs("PicWidth")
%>
<div align=center>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="<%=PicWidth%>" height="<%=PicHeight%>"><param name=movie value="<%=PicUrl%>"><param name=quality value=high>
<embed src="<%=PicUrl%>" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="<%=PicWidth%>" height="<%=PicHeight%>"></embed></object>
<br>链接:<textarea name="VoteCode" cols="52" rows="3"><%="AdsUrl.asp?AdsID="&Adsid%></textarea>
<br><a href="javascript:window.close()">关闭窗口</a>
</div>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -