<!--#include file="Cls_Ads.asp" -->
<%
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 2.0 
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
dim AdsTempLocation,TempTypes,TipWord,FileObj,ADialog
    AdsTempLocation = request("Location")
	TempTypes = request("Types")
	if AdsTempLocation = "" or TempTypes = "" then
	%>
		<script>alert('参数传递错误');history.back();</script>
	<%
	else
		select case TempTypes
			case "Dell" TipWord = "删除"
			case "Stop" TipWord = "暂停"
			case "Star" TipWord = "激活"
		  end select
		Dim ALeftPicPath,TempStateFlagState,ACycleLocation,AType,ACycleTF,APicHeight,AExplain,ARightPicPath,APicWidth
		if AdsTempLocation <> "" and TempTypes="Stop" and request.form("action")="trues" then
		   Conn.Execute("update Ads set State=2 where Location="&AdsTempLocation&"")
		   ADialog = "广告暂停成功"
		end if
		if AdsTempLocation <> "" and TempTypes="Star" and request.form("action")="trues" then
		   Conn.Execute("update Ads set State=1 where Location="&AdsTempLocation&"")
		   ADialog = "广告激活成功"
		end if
		
		Set TempStateFlag = Conn.Execute("select * from Ads where Location="&AdsTempLocation&"")
		    if not TempStateFlag.eof then
				ALeftPicPath = TempStateFlag("LeftPicPath")
				APicWidth = TempStateFlag("PicWidth")
				APicHeight = TempStateFlag("PicHeight")
				ARightPicPath = TempStateFlag("RightPicPath")
				AExplain = TempStateFlag("Explain")
				AType = TempStateFlag("Type")
				ACycleTF = TempStateFlag("CycleTF")
				ACycleLocation = TempStateFlag("CycleLocation")
				TempStateFlagState = TempStateFlag("State")
		      end if
		if TempTypes<>"Dell" then	  
			select case AType
				case "1" call ShowAds(AdsTempLocation)
				case "2" call NewWindow(AdsTempLocation)
				case "3" call OpenWindow(AdsTempLocation)
				case "4" call FilterAway(AdsTempLocation)
				case "5" call DialogBox(AdsTempLocation)
				case "6" call ClarityBox(AdsTempLocation)
				case "7" call RightBottom(AdsTempLocation)
				case "8" call DriftBox(AdsTempLocation)
				case "9" call LeftBottom(AdsTempLocation)
				case "10" call Couplet(AdsTempLocation)
			  end select
		 end if
		  
		if AdsTempLocation <> "" and TempTypes="Dell" and request.form("action")="trues" then
		   Conn.Execute("update Ads Set State=0 where Location="&AdsTempLocation&"")
		end if
		  
		if ACycleTF = "1" or ACycleLocation<>"0" then
		    if TempTypes<>"Dell" and AType <> "11" then
				call Cycle(AdsTempLocation,ACycleLocation)
			end if
		end if
		  
		if AdsTempLocation <> "" and TempTypes="Dell" and request.form("action")="trues" then
		   Conn.Execute("delete from Ads where Location="&AdsTempLocation&"")
		   Conn.Execute("delete from AdsVisitList where AdsLocation="&AdsTempLocation&"")
			Set FileObj = Server.CreateObject("Scripting.FileSystemObject")
			if FileObj.FileExists(Server.MapPath("\")&"\JS\AdsJs\"& AdsTempLocation &".js") = True then
				FileObj.DeleteFile (Server.MapPath("\")&"\JS\AdsJs\"& AdsTempLocation &".js")
			end if
		   ADialog = "广告删除成功"
		end if
			
	end if
	
		if ADialog <> "" then
		response.Write("<script>dialogArguments.location.reload();window.close();</script>")
		response.End
		end if
	
%>
<html>
<head>
<link href="../Inc/ModeWindow.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>广告管理</title>
</head>

<body topmargin="0" leftmargin="0">
<form method="post">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="3">
    <tr> 
      <td width="5%">&nbsp;</td>
      <td width="26%" rowspan="3"><div align="center"><img src="../Images/Question.gif" width="39" height="37"></div></td>
      <td width="64%">&nbsp;</td>
      <td width="5%">&nbsp;</td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td>您确定要<%=TipWord%>此广告?</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td colspan="2"><div align="center"> 
          <input type="submit" name="Submit" value=" 确 定 ">
          <input type="hidden" name="action" value="trues">
          <input type="button" onClick="window.close();" name="Submit2" value=" 取 消 " >
        </div></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>
