<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p14")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<HTML>
<HEAD>
<TITLE>获得广告代码</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style>

</HEAD>
<BODY>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<tr bgcolor="#F5F5F5">
<td style="padding:10px;">
<%
dim id
id=cint(request("id"))
if(id<1) then
	response.Write("没有找到id="&id&"的记录！")
	response.End()
end if
	Set rs = Server.CreateObject("Adodb.RecordSet")
	sql="select adType,photo,linkUrl,imgW,imgH,catalogId,content,title,moditime from ad where id="&id&" order by id desc " 
	rs.Open sql,conn,3,1
	if not rs.eof then
		tempArr=rs.GetRows()
	else
		response.Write("没有找到记录")
		response.End()
	end if
	rs.close
	set rs=nothing
''''''''''''''''''''''''''''''''''初使化''''''''''''''''''''''''''''
dim tempJsStr
tempJsStr=""
if(tempArr(0,0)=0) then
	tempJsStr="document.write('"&tempArr(6,0)&"');"&Chr(10)
elseif(tempArr(0,0)=1) then
	tempJsStr="document.write('<a href="""&tempArr(2,0)&""" target=""_blank""><img src="""&SiteUrl&"/pic/"&tempArr(1,0)&""" border=""0"" width="""&tempArr(3,0)&""" height="""&tempArr(4,0)&"""></a>');"&Chr(10)
elseif(tempArr(0,0)=2) then
	tempJsStr=tempArr(6,0)
	tempJsStr=tempJsStr&"document.write('<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"" width="""&tempArr(3,0)&""" height="""&tempArr(4,0)&""">');"&Chr(10)
  	tempJsStr=tempJsStr&"document.write('<param name=""movie"" value="""&SiteUrl&"/pic/"&tempArr(1,0)&""">');"&Chr(10)
  	tempJsStr=tempJsStr&"document.write('<param name=""quality"" value=""high"">');"&Chr(10)
  	tempJsStr=tempJsStr&"document.write('<embed src="""&SiteUrl&"/pic/"&tempArr(1,0)&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&tempArr(3,0)&""" height="""&tempArr(4,0)&"""></embed>');"&Chr(10)
	tempJsStr=tempJsStr&"document.write('</object>');"&Chr(10)
end if

Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set file_w = fs.CreateTextFile(server.mappath("../ad/js_"&id&".js"),true)	
file_w.WriteLine(tempJsStr)
file_w.close
set file_w=nothing
set fs=nothing
response.write("<p>广告"&id&"的调用代码为：<br><br><textarea cols=""40"" rows=""5"">&lt;script src=""/ad/js_"&id&".js""&gt;&lt;/script&gt;</textarea></p>")
response.write("<p>请将以上代码复制到您要插入投票的地方。</p>") 
response.write("<p><a href=""#"" onClick=""javascript:history.back()""><==返 回</a></p>") 
call connclose()
%>
</td>
</tr>
</body>
</html>