<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=5
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	dim ScrCode
	id=int(Trim(Request.QueryString("id")))
	if id="" then
		response.write"<script language=JavaScript>alert('操作有误，请重来！');"    
		response.write"this.location.href='ad_ads.asp';</script>"
		response.End
	end if
	set rs=server.createobject("adodb.recordset")
	sql="select * from wishcn_ad where id="&id&"" 
	rs.open sql,conn,2,3
	if rs.eof then
		response.write"<script language=JavaScript>alert('操作有误，请重来！');"    
		response.write"this.location.href='ad_ads.asp';</script>"
		response.End
	else
		ad1=rs("id")
		ad2=int(rs("ttype"))
		ad3=rs("pic")
		ad4=rs("wwidth")
		ad5=rs("hheight")
		ad6=rs("url")
		ad7=rs("title")
	end if
	rs.close 
	set rs = nothing 
	
	if ad2=0 then
		ScrCode="<a href="""& AD6 &""" target=_blank><img src="""& AD3 &""" border=0 width="""& AD4 &""" height="""& AD5 &""" alt="""& AD7 &""" align=top></a>"
	end if
	
	if ad2=1 then
		ScrCode="<EMBED src="""& AD3 &""" quality=high WIDTH="""& AD4 &""" HEIGHT="""& AD5 &""" TYPE=""application/x-shockwave-flash"" PLUGINSPAGE=""http://www.macromedia.com/go/getflashplayer""></EMBED>"
	end if
	
	'生成JS文件 
	FolderPath = Server.MapPath("..\ads\js\") 
	Set fso = Server.CreateObject("Scripting.FileSystemObject") 
	Set fout = fso.CreateTextFile(FolderPath&"\ads"& id &".asp")
	fout.WriteLine ScrCode
	'关闭连接 
	fout.close 
	set fout = nothing 
	
	conn.close 
	set conn=nothing
	
	response.write "<meta http-equiv='refresh' content='0;URL=ad_ads.asp'>"
%>