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

📄 admin_advertisement.asp

📁 官方最新的南方数据v12生成静态商业版。全站生成静态。
💻 ASP
📖 第 1 页 / 共 2 页
字号:


        <table width="100%" border="0" cellspacing="0" cellpadding="0" id="settable2" style="DISPLAY: none">
          <tr> 
            <td>左: 
              <input name="floatleft" type="text" id="floatleft" value='<%=floatleft%>' size="6" maxlength="5">
              上: 
              <input name="floattop" type="text" id="floattop" value='<%=floattop%>' 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='<%=fixedleft%>' size="6" maxlength="5">
              上: 
              <input name="fixedtop" type="text" id="fixedtop" value='<%=fixedtop%>' size="6" maxlength="5">            </td>
          </tr>
      </table></td>
    </tr>
    <tr class="tdbg"> 
      <td width="252"><strong>网站名称:</strong></td>
      <td width="696"> <input name="SiteName" type="text" id="SiteName" value="<%=rs("SiteName")%>" size="80" maxlength="255">      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="252"><strong>网站地址:</strong></td>
      <td width="696"> <input name="SiteUrl" type="text" id="SiteUrl" value="<%=rs("SiteUrl")%>" size="80" maxlength="255">      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="252"><strong>网站简介:</strong></td>
      <td width="696"> <input name="SiteIntro" type="text" id="SiteIntro" value="<%=rs("SiteIntro")%>" size="80" maxlength="255">      </td>
    </tr>
    <tr class="tdbg"> 
      <td width="252"><strong>图片地址:</strong></td>
      <td><input name="ImgUrl" type="text" id="ImgUrl" value="<%=rs("ImgUrl")%>" size="80" maxlength="255"></td>
    </tr>
    <tr class="tdbg"> 
      <td width="252"><strong>图片大小:</strong></td>
      <td>宽: 
        <input name="ImgWidth" type="text" id="ImgWidth" value="<%=rs("ImgWidth")%>" size="6" maxlength="5">
        像素&nbsp;&nbsp;&nbsp;&nbsp;高: 
        <input name="ImgHeight" type="text" id="ImgHeight" value="<%=rs("ImgHeight")%>" size="6" maxlength="5">
        像素</td>
    </tr>
    <tr class="tdbg"> 
      <td width="252"><strong>是否FLASH:</strong></td>
      <td> <input type="radio" name="IsFlash" value="True" <% if rs("IsFlash")=true then response.write "checked"%>>
        是&nbsp;&nbsp;&nbsp;&nbsp; <input name="IsFlash" type="radio" value="False" <% if rs("IsFlash")=false then response.write "checked"%>>
        否</td>
    </tr>
    <tr class="tdbg"> 
      <td width="252">&nbsp;</td>
      <td> <input name="IsSelected" type="checkbox" id="IsSelected" value="True" <% if rs("IsSelected")=true then response.write "checked"%>>
        设为最新广告 </td>
    </tr>
    <tr class="tdbg"> 
      <td height="40" colspan="2" align="center"> <input name="Action" type="hidden" id="Action" value="SaveModify"> 
        <input name="ID" type="hidden" id="ID" value="<%=rs("ID")%>"> 
        <input type="submit" name="Submit" value=" 保 存 "> </td>
    </tr>
  </table>
</form>
<script language=JavaScript>
showsetting()
</script>
<%
	rs.close
	set rs=nothing
end sub
%>

<table width="100%" border="0" cellspacing="1" cellpadding="2" class="table_southidc">
  <tr class="title"> 
    <td height="22" colspan="2"><strong>广告类型说明</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td>弹出广告:</td>
    <td>指采用弹出窗口形式的广告</td>
  </tr>
  <tr class="tdbg"> 
    <td>Banner广告:</td>
    <td>指页面顶部中间Banner处的广告,其大小一般为980*165</td>
  </tr>
  <tr class="tdbg"> 
    <td>浮动广告:</td>
    <td>指漂浮在页面上不断移动的广告,其大小一般为80*80 </td>
  </tr>
  <tr class="tdbg"> 
    <td>对联广告:</td>
    <td>指固定显示在页面两侧的广告</td>
  </tr>
</table>
</body>
</html>
<%
sub SaveAdd()
	dim ChannelID,ADType,SiteName,SiteUrl,SiteIntro,ImgUrl,ImgWidth,ImgHeight,IsFlash,IsSelected,ADSetting
	dim popleft,poptop,floatleft,floattop,fixedleft,fixedtop	
	ADType=Clng(request("ADType"))
	SiteName=trim(request("SiteName"))
	SiteUrl=trim(request("SiteUrl"))
	SiteIntro=trim(request("SiteIntro"))
	ImgUrl=trim(request("ImgUrl"))
	ImgWidth=trim(request("ImgWidth"))
	ImgHeight=Trim(request("ImgHeight"))
	IsFlash=trim(request("IsFlash"))
	IsSelected=trim(request("IsSelected"))
	if SiteName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站名称不能为空!</li>"
	end if
	if SiteUrl="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站地址不能为空!</li>"
	end if
	if SiteIntro="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站简介不能为空!</li>"
	end if
	if ImgUrl="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>广告图片不能为空!</li>"
	end if
	if FoundErr=True then
		exit sub
	end if
	
	if SiteUrl="http://" then SiteUrl="http://www.southidc.net"
	if ImgWidth="" then 
		ImgWidth=0
	else
		ImgWidth=Cint(ImgWidth)
	end if
	if ImgHeight="" then
		ImgHeight=0
	else
		ImgHeight=Cint(ImgHeight)
	end if
	if IsFlash="" then IsFlash=false
	if IsSelected="" then IsSelected=false

	
	if ADType=0 then
		if trim(request("popleft"))="" then popleft=0 else popleft=trim(request("popleft"))
		if trim(request("poptop"))="" then poptop=0 else poptop=trim(request("poptop"))
		ADSetting=popleft & "|" & poptop
	elseif ADType=2 then
		if trim(request("floatleft"))="" then floatleft=0 else floatleft=trim(request("floatleft"))
		if trim(request("floattop"))="" then floattop=0 else floattop=trim(request("floattop"))
		ADSetting=floatleft & "|" & floattop
	elseif ADType=3 then
		if trim(request("fixedleft"))="" then fixedleft=0 else fixedleft=trim(request("fixedleft"))
		if trim(request("fixedtop"))="" then fixedtop=0 else fixedtop=trim(request("fixedtop"))
		ADSetting=fixedleft & "|" & fixedtop
	end if

	sql="select * from 0791idc_Advertisement"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.addnew	
	rs("ADType")=ADType
	rs("ADSetting")=ADSetting
	rs("SiteName")=SiteName
	rs("SiteUrl")=SiteUrl
	rs("SiteIntro")=SiteIntro
	rs("ImgUrl")=ImgUrl
	rs("ImgWidth")=ImgWidth
	rs("ImgHeight")=ImgHeight
	rs("IsFlash")=IsFlash
	rs("IsSelected")=IsSelected
	rs.update
	rs.close
	set rs=nothing
	call CloseConn()
	response.redirect "Admin_Advertisement.asp"
end sub

sub SaveModify()
	dim sql,rs
	dim ID,ChannelID,ADType,SiteName,SiteUrl,SiteIntro,ImgUrl,ImgWidth,ImgHeight,IsFlash,IsSelected,ADSetting
	dim popleft,poptop,floatleft,floattop,fixedleft,fixedtop
	ID=trim(request("ID"))	
	ADType=Clng(request("ADType"))
	SiteName=trim(request("SiteName"))
	SiteUrl=trim(request("SiteUrl"))
	SiteIntro=trim(request("SiteIntro"))
	ImgUrl=trim(request("ImgUrl"))
	ImgWidth=trim(request("ImgWidth"))
	ImgHeight=Trim(request("ImgHeight"))
	IsFlash=trim(request("IsFlash"))
	IsSelected=trim(request("IsSelected"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
	else
		ID=Clng(ID)
	end if
	if SiteName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站名称不能为空!</li>"
	end if
	if SiteUrl="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站地址不能为空!</li>"
	end if
	if SiteIntro="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>网站简介不能为空!</li>"
	end if
	if ImgUrl="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>广告图片不能为空!</li>"
	end if
	if FoundErr=True then
		exit sub
	end if
	if SiteUrl="http://" then SiteUrl="http://www.southidc.net"
	if ImgWidth="" then 
		ImgWidth=0
	else
		ImgWidth=Cint(ImgWidth)
	end if
	if ImgHeight="" then
		ImgHeight=0
	else
		ImgHeight=Cint(ImgHeight)
	end if
	if IsFlash="" then IsFlash=false
	if IsSelected="" then IsSelected=false

	if ADType=0 then
		if trim(request("popleft"))="" then popleft=0 else popleft=trim(request("popleft"))
		if trim(request("poptop"))="" then poptop=0 else poptop=trim(request("poptop"))
		ADSetting=popleft & "|" & poptop
	elseif ADType=2 then
		if trim(request("floatleft"))="" then floatleft=0 else floatleft=trim(request("floatleft"))
		if trim(request("floattop"))="" then floattop=0 else floattop=trim(request("floattop"))
		ADSetting=floatleft & "|" & floattop
	elseif ADType=3 then
		if trim(request("fixedleft"))="" then fixedleft=0 else fixedleft=trim(request("fixedleft"))
		if trim(request("fixedtop"))="" then fixedtop=0 else fixedtop=trim(request("fixedtop"))
		ADSetting=fixedleft & "|" & fixedtop
	end if

	sql="select * from 0791idc_Advertisement where ID=" & ID
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	if rs.bof and rs.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>找不到指定的广告!</li>"
		rs.close
		set rs=nothing
		exit sub
	end if	
	rs("ADType")=ADType
	rs("ADSetting")=ADSetting
	rs("SiteName")=SiteName
	rs("SiteUrl")=SiteUrl
	rs("SiteIntro")=SiteIntro
	rs("ImgUrl")=ImgUrl
	rs("ImgWidth")=ImgWidth
	rs("ImgHeight")=ImgHeight
	rs("IsFlash")=IsFlash
	rs("IsSelected")=IsSelected
	rs.update
	rs.close
	set rs=nothing
	call CloseConn()
	response.redirect strFileName
end sub

sub SetNew()
	dim ID
	ID=Trim(Request("ID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
		exit sub
	end if
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "Update 0791IDC_Advertisement set IsSelected="&TrueType&" Where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "Update 0791IDC_Advertisement set IsSelected="&TrueType&" Where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub

sub CancelNew()
	dim ID
	ID=Trim(Request("ID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
		exit sub
	end if
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "Update 0791IDC_Advertisement set IsSelected="&FalseType&" Where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "Update 0791IDC_Advertisement set IsSelected="&FalseType&" Where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub

sub MoveAdvertisement()
	dim ID,MoveChannelID
	ID=Trim(Request("ID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
		exit sub
	end if
	MoveChannelID=Trim(Request("ChannelID"))
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
			conn.execute "Update 0791IDC_Advertisement set ChannelID = "& MoveChannelID & " where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "Update 0791IDC_Advertisement set ChannelID = "& MoveChannelID & " where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub

sub DelAD()
	dim ID
	ID=Trim(Request("ID"))
	if ID="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>请指定广告ID</li>"
		exit sub
	end if
	if Instr(ID,",")>0 then
		dim arrID,i
		arrID=split(ID,",")
		for i=0 to Ubound(arrID)
		conn.execute "delete from 0791idc_Advertisement where ID=" & CLng(arrID(i))
		next
	else
		conn.execute "delete from 0791idc_Advertisement where ID=" & CLng(ID)
	end if
	response.redirect strFileName
end sub
%>

⌨️ 快捷键说明

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