📄 admin_advertisement.asp
字号:
<%@language=vbscript codepage=936 %>
<%
response.buffer=true
%>
<!--#include file="conn.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim sql,rs,strFileName
dim Action,Channel,FoundErr,ErrMsg
Action=Trim(Request("Action"))
strFileName="Admin_Advertisement.asp"
%>
<SCRIPT language=javascript>
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = form.chkAll.checked;
}
}
function ConfirmDel()
{
if(document.myform.Action.value=="Del")
{
if(confirm("确定要删除选中的广告吗?"))
return true;
else
return false;
}
}
function showsetting(){
for (var j=0;j<4;j++)
{
var tab = eval("document.all.settable"+j);
if(form1.ADType.selectedIndex==j)
tab.style.display = "";
else
tab.style.display = "none";
}
// settingshowtext.innerText="我想同时注册成为贵站会员"
}
</script>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table_southidc">
<tr class="topbg">
<td height="22" colspan=2 align=center><strong>广 告 管 理</strong></td>
</tr>
<tr class="td_southidc">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30"><a href="Admin_Advertisement.asp?Action=Add">添加新广告</a> | <a href="Admin_Advertisement.asp">所有广告</a>
|</td>
</tr>
</table>
<%
if Action="Add" then
call Add()
elseif Action="SaveAdd" then
call SaveAdd()
elseif Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
elseif Action="SetNew" then
call SetNew()
elseif Action="CancelNew" then
call CancelNew()
elseif Action="Move" then
call MoveAdvertisement()
elseif Action="Del" then
call DelAD()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
sql="select * from 0791idc_Advertisement"
sql=sql & " order by IsSelected,id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<form name="myform" method="POST" action=<%=strFileName%> onSubmit="return ConfirmDel();">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table_southidc">
<tr class="title">
<td width="30" height="22" align="center"><strong>选择</strong></td>
<td width="30" height="22" align="center"><strong>ID</strong></td>
<td width="20" align="center"><strong>新</strong></td>
<td width="80" align="center"><strong>广告类型</strong></td>
<td width="100" height="22" align="center"><strong>网站名称</strong></td>
<td width="80" height="22" align="center"><strong>操作</strong></td>
</tr>
<%
if not(rs.bof and rs.eof) then
do while not rs.eof
%>
<tr class="td_southidc" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#BFDFFF'">
<td width="30" align="center">
<input type="checkbox" value=<%=rs("ID")%> name="ID"> </td>
<td width="30" align="center"><%=rs("ID")%></td>
<td width="20" align="center">
<%if rs("IsSelected")=true then response.write "<font color=#009900>新</font>" end if%> </td>
<td width="80" align="center">
<%
if rs("ADType")=0 then
response.write "弹出广告"
elseif rs("ADType")=1 then
response.write "Banner广告"
elseif rs("ADType")=2 then
response.write "浮动广告"
elseif rs("ADType")=3 then
response.write "对联广告"
else
response.write "其它广告"
end if
%> </td>
<td width="100"><a href="<%=rs("SiteUrl")%>" target='blank' title="网站地址:<%=rs("SiteUrl") & vbcrlf %>网站简介:<%=vbcrlf & rs("SiteIntro")%>"><%=rs("SiteName")%></a></td>
<td width="80" align="center">
<%
response.write "<a href='" & strFileName & "?Action=Modify&ID=" & rs("ID") & "'>修改</a> "
response.write "<a href='" & strFileName & "?Action=Del&ID=" & rs("ID") & "'>删除</a>"
%> </td>
</tr>
<%
rs.movenext
loop
%>
<tr class="tdbg">
<td colspan=6 height="30">
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中所有广告
<input name="Action" type="hidden" id="Action" value="del">
将选定的广告:
<input type="submit" value=" 删除 " name="submit" onClick="document.myform.Action.value='Del'">
<input type="submit" value="设为最新广告" name="submit" onClick="document.myform.Action.value='SetNew'">
<input type="submit" value="取消最新广告" name="submit" onClick="document.myform.Action.value='CancelNew'">
</td>
</tr>
<% end if%>
</table>
</form>
<%
rs.close
set rs=nothing
end sub
sub Add()
%>
<form name="form1" method="post" action="<%=strFileName%>">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table_southidc">
<tr class="title">
<td height="22" colspan="2" align="center"><strong>添 加 广 告</strong></td>
</tr>
<tr class="tdbg">
<td><strong>广告类型:</strong></td>
<td> <select name="ADType" id="ADType" onchange=showsetting()>
<option value="0" selected >弹出广告</option>
<option value="1" >Banner广告</option>
<option value="2" >浮动广告</option>
<option value="3" >对联广告</option>
</select> </td>
</tr>
<tr class="tdbg">
<td width="254"><strong>广告设置:</strong></td>
<td width="694" height="26">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable0">
<tr>
<td>左:
<input name="popleft" type="text" id="popleft" value="100" size="6" maxlength="5">
上:
<input name="poptop" type="text" id="poptop" value="100" size="6" maxlength="5">
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable1" style="DISPLAY: none">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable2" style="DISPLAY: none">
<tr>
<td>左:
<input name="floatleft" type="text" id="floatleft" value="100" size="6" maxlength="5">
上:
<input name="floattop" type="text" id="floattop" value="100" size="6" maxlength="5">
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable3" style="DISPLAY: none">
<tr>
<td>左:
<input name="fixedleft" type="text" id="fixedleft" value="100" size="6" maxlength="5">
上:
<input name="fixedtop" type="text" id="fixedtop" value="100" size="6" maxlength="5">
</td>
</tr>
</table></td>
</tr>
<tr class="tdbg">
<td width="254"><strong>网站名称:</strong></td>
<td width="694"> <input name="SiteName" type="text" id="SiteName" value="" size="80" maxlength="255">
</td>
</tr>
<tr class="tdbg">
<td width="254"><strong>网站地址:</strong></td>
<td width="694"> <input name="SiteUrl" type="text" id="SiteUrl" value="http://" size="80" maxlength="255">
</td>
</tr>
<tr class="tdbg">
<td width="254"><strong>网站简介:</strong></td>
<td width="694"> <input name="SiteIntro" type="text" id="SiteIntro" size="80" maxlength="255">
</td>
</tr>
<tr class="tdbg">
<td width="254"><strong>图片地址:</strong><br>
图片格式为:jpg,gif,bmp,png,swf</td>
<td> <input name="ImgUrl" type="text" id="ImgUrl" size="80" maxlength="255">
</td>
</tr>
<tr class="tdbg">
<td width="254"><strong>图片大小:</strong></td>
<td>宽:
<input name="ImgWidth" type="text" id="ImgWidth" value="480" size="6" maxlength="5">
像素 高:
<input name="ImgHeight" type="text" id="ImgHeight" value="60" size="6" maxlength="5">
像素</td>
</tr>
<tr class="tdbg">
<td width="254"><strong>是否FLASH:</strong></td>
<td> <input type="radio" name="IsFlash" value="True">
是 <input name="IsFlash" type="radio" value="False" checked>
否</td>
</tr>
<tr class="tdbg">
<td width="254"> </td>
<td> <input name="IsSelected" type="checkbox" id="IsSelected" value="True" checked>
设为最新广告 </td>
</tr>
<tr class="tdbg">
<td height="40" colspan="2" align="center"> <input name="Action" type="hidden" id="Action" value="SaveAdd">
<input type="submit" name="Submit" value=" 添 加 "> </td>
</tr>
</table>
</form>
<%
end sub
sub Modify()
dim ID,arrSetting,popleft,poptop,floatleft,floattop,fixedleft,fixedtop
ID=trim(request("ID"))
if ID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
exit sub
else
ID=Clng(ID)
end if
sql="select * from 0791idc_Advertisement where ID=" & ID
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的广告!</li>"
rs.close
set rs=nothing
exit sub
end if
popleft="100"
poptop="100"
floatleft="100"
floattop="100"
fixedleft="100"
fixedtop="100"
if rs("ADType")=0 then
if instr(rs("ADSetting"),"|")>0 then
arrSetting=split(rs("ADSetting"),"|")
popleft=arrsetting(0)
poptop=arrsetting(1)
end if
elseif rs("ADType")=2 then
if instr(rs("ADSetting"),"|")>0 then
arrSetting=split(rs("ADSetting"),"|")
floatleft=arrsetting(0)
floattop=arrsetting(1)
end if
elseif rs("ADType")=3 then
if instr(rs("ADSetting"),"|")>0 then
arrSetting=split(rs("ADSetting"),"|")
fixedleft=arrsetting(0)
fixedtop=arrsetting(1)
end if
end if
%>
<form name="form1" method="post" action="<%=strFileName%>" >
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table_southidc">
<tr class="title">
<td height="22" colspan="2" align="center"><strong>修 改 广 告</strong></td>
</tr>
<tr class="tdbg">
<td><strong>广告类型:</strong></td>
<td> <select name="ADType" id="ADType" onchange=showsetting()>
<option value="0" <%if rs("ADType")=0 then response.write "selected"%>>弹出广告</option>
<option value="1" <%if rs("ADType")=1 then response.write "selected"%>>Banner广告</option>
<option value="2" <%if rs("ADType")=2 then response.write "selected"%>>浮动广告</option>
<option value="3" <%if rs("ADType")=3 then response.write "selected"%>>对联广告</option>
</select></td>
</tr>
<tr class="tdbg">
<td width="252"><strong>广告设置:</strong></td>
<td width="696" height="26"> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable0">
<tr>
<td>左:
<input name="popleft" type="text" id="popleft" value='<%=popleft%>' size="6" maxlength="5">
上:
<input name="poptop" type="text" id="poptop" value='<%=poptop%>' size="6" maxlength="5"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable1" style="DISPLAY: none">
<tr>
<td> </td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -