<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p22")
'''''''''''''''''''''''''''''''''''''''''''''''
dim currentpage,totalpage,totalnum,recpage,urls,listtitle,act
dim f_lptypeid,f_positionid,f_adtype,f_title,f_src,f_width,f_height,f_url,js_str
recpage=20
dim lp_id,lpareaid,infotypeid,title
act=request.querystring("act")
if(request.QueryString("page")<>"") then
	currentpage=Clng(request.QueryString("page"))
else
	currentpage=1
end if
if(request.QueryString("lp_id")<>"") then
	lp_id=Clng(request.QueryString("lp_id"))
else
	lp_id=0
end if
urls="lp_id="&lp_id
%>
<html>
<head>
<title>楼盘广告管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
}
-->
</style>
<link href="style/global.css" rel="stylesheet" type="text/css">
<script language="javascript">
function goto(frm)
{
	var gourl ="?lp_id<%=lp_id%>&";
	gourl += "page=" + (frm.page.value);
     var hid=parseInt(frm.hid.value);
	 if(parseInt(frm.page.value)>hid||frm.page.value<=0){
	 alert("错误！请确定你输入的数字在1-"+hid+"之间");
	 return false;
	 }
	window.location.href=gourl;
}
function check(obj){
	if(obj.f_width.value==""){
		alert("广告宽度不能为空!");
		obj.f_width.focus();
		return false;
	}
	if(obj.f_height.value==""){
		alert("广告高度不能为空!");
		obj.f_height.focus();
		return false;
	}
	return true;
}
function ConfirmDel()
{
   if(confirm("确认删除？并且不能恢复！确定要删除此信息吗？"))
     return true;
   else
     return false;
	 
}
function checkint(elem)
{
  var checkOK = "0123456789";
  var checkStr = elem.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
		ch = checkStr.charAt(i);
    	for (j = 0;  j < checkOK.length;  j++)
      	if (ch == checkOK.charAt(j))
        break;
    	if (j == checkOK.length)
    	{
      		allValid = false;
      		break;
    	}
  }
  if (!allValid)
  {
    	alert("只能输入数字。");
    	elem.focus();
			elem.select();
    	return (false);
  }
  return (true);
}

</script>
<script language="JavaScript" src="../js/PublicJS.js"></script>
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style4 {color: #000000}
-->
</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" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td height="22" bgcolor="#FF9900"><div align="center"><span class="style1">◆ 楼盘信息管理 ◆</span></div></td>
  </tr>
</table>
<%
if(act="add") then
%>
<form action="?act=doadd" method="post" onSubmit="return check(this)">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td height="22" colspan="2" bgcolor="#F5F5F5"><div align="center">添加楼盘广告</div></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">物业类型：</div></td>
    <td bgcolor="#FFFFFF"><select name="f_lptypeid" id="f_lptypeid">
      <%=getResourceOption("t_lp_type",0)%>
    </select></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">广告位置：</div></td>
    <td bgcolor="#FFFFFF"><select name="f_positionid" id="f_positionid">
      <option value="1">全屏广告</option>
      <option value="2">移动文字</option>
      <option value="3">固定文字</option>
      <option value="4">大通栏</option>
	  <option value="5">擎天柱1</option>
	  <option value="6">对联广告</option>
	  <option value="7">顶部通栏</option>
	  <option value="8">擎天柱2</option>
	  <option value="9">旗帜</option>
    </select>    </td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">广告类别：</div></td>
    <td bgcolor="#FFFFFF"><input name="f_adtype" type="radio" value="0">
      图片
        <input name="f_adtype" type="radio" value="1" checked> 
        flash
        <input name="f_adtype" type="radio" value="2">
文字</td>
  </tr>
  <tr>
    <td width="28%" height="22" bgcolor="#FFFFFF"><div align="right">描述：</div></td>
    <td width="72%" bgcolor="#FFFFFF"><div align="left">
      <input name="f_title" type="text" id="f_title">
    </div></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">广告源：</div></td>
    <td bgcolor="#FFFFFF"><div align="left">
      <input name="f_src" type="text" id="f_src" size="50">
      <input type="button" name="Button" value="上传->" onClick="javascript:document.forms[0].f_src.value=window.showModalDialog('upimg.htm','','dialogHeight:130px;dialogWidth:410px;help:no;status:no;scroll:no')">
    (点击上传图片或flash)</div></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">宽度：</div></td>
    <td height="22" bgcolor="#FFFFFF"><input name="f_width" type="text" id="f_width" onBlur="checkint(this)"></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">高度：</div></td>
    <td height="22" bgcolor="#FFFFFF"><input name="f_height" type="text" id="f_height" onBlur="checkint(this)"></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">(链接)URL：</div></td>
    <td height="22" bgcolor="#FFFFFF"><textarea name="f_url" cols="55" id="f_url"></textarea>
      广告类别为“图片”时填写图片的链接地址，类型为“文字”时，填写文字的链接HTM代码</td>
  </tr>
  <tr>
    <td height="22" colspan="2" bgcolor="#FFFFFF"><div align="center">
      <input type="submit" name="Submit" value="提 交">&nbsp;&nbsp;
      <input type="reset" name="Submit3" value="重 写">
    </div></td>
    </tr>
</table>
</form>
<%
elseif(act="doadd") then
	
	f_lptypeid=Cint(request.form("f_lptypeid"))
	f_positionid=Cint(request.form("f_positionid"))
	f_adtype=Cint(request.form("f_adtype"))
	f_title=request.form("f_title")
	f_src=request.form("f_src")
	f_width=request.form("f_width")
	f_height=request.form("f_height")
	f_url=request.form("f_url")
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_lp_ad",conn,3,3
	rs.addnew
	rs("f_lptypeid")=f_lptypeid
	rs("f_positionid")=f_positionid
	rs("f_adtype")=f_adtype
	rs("f_title")=f_title
	rs("f_src")=f_src
	rs("f_width")=f_width
	rs("f_height")=f_height
	rs("f_url")=f_url
	rs("f_date")=now()
	rs.update
	rs.close
	set rs=nothing
	response.write("<p align=""center"">成功添加楼盘广告!<a href=""?f_lptypeid="&f_lptypeid&""">返回管理</a>&nbsp;<a href=""javascript:history.back();"">继续添加</a></p>")
	'生成js
	if(f_positionid=1) then
		if(f_adtype=0) then'图片广告
			js_str="document.write('<div id=""fullScreenAd""><a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a></div>');"&Chr(10)
		elseif(f_adtype=1) then'flash广告	
			js_str=js_str&"document.write('<div id=""fullScreenAd""><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="""&f_width&""" height="""&f_height&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""movie"" value="""&f_src&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""quality"" value=""high"">');"&Chr(10)
			js_str=js_str&"document.write('<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed></object></div>');"&Chr(10)
		end if
		js_str=js_str&"function fullScreen(){	document.getElementById('fullScreenAd').style.display='none';}"&Chr(10)
		js_str=js_str&"function fullScreenLoad(){	setTimeout(""fullScreen()"",5000);}"&Chr(10)
		js_str=js_str&"fullScreenLoad();"&Chr(10)
	elseif(f_positionid=6) then
		if(f_adtype=0) then'图片广告
			js_str="theFloaters.addItem('followDiv1','document.body.clientWidth-100',0,'<a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a>');"&Chr(10)
		js_str=js_str&"theFloaters.addItem('followDiv2',0,0,'<a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a>');"&Chr(10)
		elseif(f_adtype=1) then'flash广告	
			js_str="theFloaters.addItem('followDiv1','document.body.clientWidth-100',0,'<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed>');"&Chr(10)
		js_str=js_str&"theFloaters.addItem('followDiv2',0,0,'<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed>');"&Chr(10)
		end if		
		js_str=js_str&"theFloaters.play();"&Chr(10)
	else
		if(f_adtype=0) then'图片广告
			js_str="document.write('<a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a>');"&Chr(10)
		elseif(f_adtype=1) then'flash广告	
			js_str=js_str&"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="""&f_width&""" height="""&f_height&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""movie"" value="""&f_src&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""quality"" value=""high"">');"&Chr(10)
			js_str=js_str&"document.write('<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed>');"&Chr(10)
			js_str=js_str&"document.write('</object>');"&Chr(10)
		elseif(f_adtype=2) then'文本广告
			js_str="document.write('<a href="""&f_url&""" target=""_blank"">"&f_title&"</a>');"&Chr(10)
		end if		
	end if
	'生成JS
	call SaveTextFile(server.mappath("../ad/lp/"&f_lptypeid&"_"&f_positionid&".js"),js_str)
elseif(act="mod") then	
	id=Clng(request.querystring("id"))
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_lp_ad where id="&id,conn,3,1
	if not rs.eof then
%>
<form action="?act=domod&id=<%=id%>" method="post" onSubmit="return check(this)">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td height="22" colspan="2" bgcolor="#F5F5F5"><div align="center">添加楼盘广告</div></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">物业类型：</div></td>
    <td bgcolor="#FFFFFF"><select name="f_lptypeid" id="f_lptypeid">
      <%=getResourceOption("t_lp_type",rs("f_lptypeid"))%>
    </select></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">广告位置：</div></td>
    <td bgcolor="#FFFFFF"><select name="f_positionid" id="f_positionid">
      <option value="1" <%if(rs("f_positionid")=1) then response.write("selected") end if%>>全屏广告</option>
      <option value="2" <%if(rs("f_positionid")=2) then response.write("selected") end if%>>移动文字</option>
      <option value="3" <%if(rs("f_positionid")=3) then response.write("selected") end if%>>固定文字</option>
      <option value="4" <%if(rs("f_positionid")=4) then response.write("selected") end if%>>大通栏</option>
	  <option value="5" <%if(rs("f_positionid")=5) then response.write("selected") end if%>>擎天柱1)</option>
	  <option value="6" <%if(rs("f_positionid")=6) then response.write("selected") end if%>>对联广告</option>
	  <option value="7" <%if(rs("f_positionid")=7) then response.write("selected") end if%>>顶部通栏</option>
	  <option value="8" <%if(rs("f_positionid")=8) then response.write("selected") end if%>>擎天柱2</option>
	  <option value="9" <%if(rs("f_positionid")=9) then response.write("selected") end if%>>旗帜</option>
    </select>    </td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">广告类别：</div></td>
    <td bgcolor="#FFFFFF"><input name="f_adtype" type="radio" value="0" <%if(rs("f_adtype")=0) then response.write("checked") end if%>>
      图片
        <input name="f_adtype" type="radio" value="1" <%if(rs("f_adtype")=1) then response.write("checked") end if%>> 
        flash
        <input name="f_adtype" type="radio" value="2" <%if(rs("f_adtype")=2) then response.write("checked") end if%>>
文字</td>
  </tr>
  <tr>
    <td width="28%" height="22" bgcolor="#FFFFFF"><div align="right">描述：</div></td>
    <td width="72%" bgcolor="#FFFFFF"><div align="left">
      <input name="f_title" type="text" id="f_title" value="<%=rs("f_title")%>">
    </div></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">广告源：</div></td>
    <td bgcolor="#FFFFFF"><div align="left">
      <input name="f_src" type="text" id="f_src" value="<%=rs("f_src")%>" size="50">
      <input type="button" name="Button" value="上传->" onClick="javascript:document.forms[0].f_src.value=window.showModalDialog('upimg.htm','','dialogHeight:130px;dialogWidth:410px;help:no;status:no;scroll:no')">
    (点击上传图片或flash)</div></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">宽度：</div></td>
    <td height="22" bgcolor="#FFFFFF"><input name="f_width" type="text" id="f_width" value="<%=rs("f_width")%>" onBlur="checkint(this)"></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">高度：</div></td>
    <td height="22" bgcolor="#FFFFFF"><input name="f_height" type="text" id="f_height" value="<%=rs("f_height")%>" onBlur="checkint(this)"></td>
  </tr>
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="right">(链接)URL：</div></td>
    <td height="22" bgcolor="#FFFFFF"><textarea name="f_url" cols="55"><%=rs("f_url")%></textarea>
      广告类别为“图片”时填写图片的链接地址，类型为“文字”时，填写文字的链接HTM代码</td>
  </tr>
  <tr>
    <td height="22" colspan="2" bgcolor="#FFFFFF"><div align="center">
      <input type="submit" name="Submit" value="提 交">&nbsp;&nbsp;
      <input type="reset" name="Submit3" value="重 写">
    </div></td>
    </tr>
</table>
</form>
<%
	end if
	rs.close
	set rs=nothing
elseif(act="domod") then
	id=Clng(request.querystring("id"))
	f_lptypeid=Cint(request.form("f_lptypeid"))
	f_positionid=Cint(request.form("f_positionid"))
	f_adtype=Cint(request.form("f_adtype"))
	f_title=request.form("f_title")
	f_src=request.form("f_src")
	f_width=request.form("f_width")
	f_height=request.form("f_height")
	f_url=request.form("f_url")
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_lp_ad where id="&id,conn,3,3
	rs("f_lptypeid")=f_lptypeid
	rs("f_positionid")=f_positionid
	rs("f_adtype")=f_adtype
	rs("f_title")=f_title
	rs("f_src")=f_src
	rs("f_width")=f_width
	rs("f_height")=f_height
	rs("f_url")=f_url
	rs("f_date")=now()
	rs.update
	rs.close
	set rs=nothing
	response.write("<p align=""center"">成功修改楼盘广告!<a href=""javascript:history.go(-2);"">返回管理</a>&nbsp;<a href=""javascript:history.go(-2);"">继续修改</a></p>")
	'生成js
	if(f_positionid=1) then
		if(f_adtype=0) then'图片广告
			js_str="document.write('<div id=""fullScreenAd""><a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a></div>');"&Chr(10)
		elseif(f_adtype=1) then'flash广告	
			js_str=js_str&"document.write('<div id=""fullScreenAd""><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="""&f_width&""" height="""&f_height&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""movie"" value="""&f_src&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""quality"" value=""high"">');"&Chr(10)
			js_str=js_str&"document.write('<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed></object></div>');"&Chr(10)
		end if
		js_str=js_str&"function fullScreen(){	document.getElementById('fullScreenAd').style.display='none';}"&Chr(10)
		js_str=js_str&"function fullScreenLoad(){	setTimeout(""fullScreen()"",5000);}"&Chr(10)
		js_str=js_str&"fullScreenLoad();"&Chr(10)
	elseif(f_positionid=6) then
		if(f_adtype=0) then'图片广告
			js_str="theFloaters.addItem('followDiv1','document.body.clientWidth-100',0,'<a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a>');"&Chr(10)
		js_str=js_str&"theFloaters.addItem('followDiv2',0,0,'<a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a>');"&Chr(10)
		elseif(f_adtype=1) then'flash广告	
			js_str="theFloaters.addItem('followDiv1','document.body.clientWidth-100',0,'<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed>');"&Chr(10)
		js_str=js_str&"theFloaters.addItem('followDiv2',0,0,'<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed>');"&Chr(10)
		end if		
		js_str=js_str&"theFloaters.play();"&Chr(10)
	else
		if(f_adtype=0) then'图片广告
			js_str="document.write('<a href="""&f_url&""" target=""_blank""><img src="""&f_src&""" border=""0"" width="""&f_width&""" height="""&f_height&"""></a>');"&Chr(10)
		elseif(f_adtype=1) then'flash广告	
			js_str=js_str&"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="""&f_width&""" height="""&f_height&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""movie"" value="""&f_src&""">');"&Chr(10)
			js_str=js_str&"document.write('<param name=""quality"" value=""high"">');"&Chr(10)
			js_str=js_str&"document.write('<embed src="""&f_src&""" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="""&f_width&""" height="""&f_height&"""></embed>');"&Chr(10)
			js_str=js_str&"document.write('</object>');"&Chr(10)
		elseif(f_adtype=2) then'文本广告			
			js_str="document.write('<a href="""&f_url&""" target=""_blank"">"&f_title&"</a>');"&Chr(10)
		end if
	end if
	
	'生成JS
	call SaveTextFile(server.mappath("../ad/lp/"&f_lptypeid&"_"&f_positionid&".js"),js_str)
	response.Write("susscess save file to:"&server.mappath("../ad/lp/"&f_lptypeid&"_"&f_positionid&".js"))
elseif(act="do") then
	dim obj,objArr,flags,do_type
	do_type=request.form("do_type")
	if not isempty(request.Form("obj")) then
		obj=request.Form("obj")
	else
		response.Write("请选择需要操作的记录")
		response.Write("<a href=""#"" onClick=""javascript:history.back();"">返回</a>")
		response.End()
	end if
	objArr=split(obj,",")
		for i=0 to ubound(objArr)	
			if(do_type="del") then
				set rs=server.CreateObject("adodb.recordset")
				rs.open "select f_lptypeid,f_positionid from t_lp_ad where id="&objArr(i),conn,3,1
				if not rs.eof then
					f_lptypeid=rs(0)
					f_positionid=rs(1)
				end if
				rs.close
				set rs=nothing				
				conn.execute("delete from t_lp_ad where id="&objArr(i))
				call DeleteFile(server.mappath("../ad/lp/"&f_lptypeid&"_"&f_positionid&".js"))
			end if				
		next
	
	response.Write("批量执行成功！")		
	response.Redirect(request.ServerVariables("HTTP_REFERER"))
else
	if(request.querystring("f_lptypeid")<>"") then
		f_lptypeid=Cint(request.querystring("f_lptypeid"))
	else
		f_lptypeid=0
	end if
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td height="22" bgcolor="#FFFFFF"><div align="center"><a href="?act=add"><strong>
      <select name="f_lptypeid" onChange="location.href='?f_lptypeid='+this.options[this.selectedIndex].value">
        <option value="0">全部..</option>
        <%=getResourceOption("t_lp_type",f_lptypeid)%>
      </select>
    添加楼盘广告</strong></a></div></td>
  </tr>
</table>
<form action="?act=do" method="post" name="mem" style="margin:0px; padding:0px;">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
      <tr>
        <td width="9%" bgcolor="#F5F5F5" class="style1"><div align="center" class="style4"></div></td>
        <td width="27%" height="22" bgcolor="#F5F5F5"><div align="center"><strong>广告名称</strong></div></td>
        <td width="16%" bgcolor="#F5F5F5"><div align="center"><strong>类型</strong></div></td>
        <td width="13%" bgcolor="#F5F5F5" class="style4"><div align="center"><strong>广告位置</strong></div></td>
        <td width="13%" bgcolor="#F5F5F5" class="style4"><div align="center" class="style4"><strong>宽度</strong></div></td>
        <td width="11%" bgcolor="#F5F5F5" class="style4"><div align="center"><strong>高度</strong></div></td>
        <td width="11%" bgcolor="#F5F5F5" class="style4"><div align="center" class="style4"><strong>修改</strong></div></td>
    </tr>
	  <%
		dim csql,qsql
		csql="select count(*) AS co from t_lp_ad where 1=1"
		if(f_lptypeid>0) then
			csql=csql&" and f_lptypeid="&f_lptypeid
		end if		
		qsql="select top "&recpage&" id,f_lptypeid,f_positionid,f_adtype,f_title,f_src,f_width,f_height,f_url,f_date from t_lp_ad where id <=(select min(id) from (select top "&(recpage*(currentpage-1)+1)&" id from t_lp_ad where 1=1"
		if(f_lptypeid>0) then
			qsql=qsql&" and f_lptypeid="&f_lptypeid
		end if
		
		qsql=qsql&" order by id desc) as t)"
		if(f_lptypeid>0) then
			qsql=qsql&" and f_lptypeid="&f_lptypeid
		end if		
		qsql=qsql&" order by id desc "			
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	  allrec=conn.execute(csql)(0)
	  totalpage=Cint((allrec-1+recpage)/recpage)
	  set rs=server.createobject("adodb.recordset")
		rs.open qsql,conn,3,1
		if not rs.eof then
			listArr=rs.getrows()
		end if
		rs.close
		set rs=nothing
	  if(isarray(listArr)) then
	  	for j=0 to ubound(listArr,2)
	  %>
      <tr>
        <td bgcolor="#FFFFFF"><div align="center">
          <input type="checkbox" name="obj" value="<%=listArr(0,j)%>" />
        </div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="left"><%=listArr(4,j)%></div></td>
        <td bgcolor="#FFFFFF"><div align="center">
		<%
		if(listArr(3,j)=0) then
		 	response.write("图片") 
		elseif(listArr(3,j)=1) then
		  	response.write("flash") 
		else
		 	 response.Write("文字") 
		end if
		%></div></td>
        <td bgcolor="#FFFFFF"><div align="center">
				<%
				if(listArr(2,j)=1) then
					response.write("全屏广告")
				elseif(listArr(2,j)=2) then
					response.write("移动文字")
				elseif(listArr(2,j)=3) then
					response.write("固定文字")
				elseif(listArr(2,j)=4) then
					response.write("大通栏")
				elseif(listArr(2,j)=5) then
					response.write("擎天柱(左侧)")
				elseif(listArr(2,j)=6) then
					response.write("对联广告")
				elseif(listArr(2,j)=7) then
					response.write("顶部通栏")
				end if
				%>
				</div></td>
        <td bgcolor="#FFFFFF"><div align="center"><%=listArr(6,j)%></div></td>
        <td bgcolor="#FFFFFF"><div align="center"><%=listArr(7,j)%></div></td>
        <td bgcolor="#FFFFFF"><div align="center"><a href="?act=mod&id=<%=listArr(0,j)%>">修改</a></div></td>
      </tr>
	  <%
	    next
	  else
	  	response.Write("<tr><td colspan=""5"">暂时没有记录</td></tr>")
	  end if
	  set carr=nothing
	  %>
  </table>

<div align="center">
  <input class=Button type="button" name="chksel" value="反选" onClick="ContraSel(this.form)">
  &nbsp;
  <select name="do_type" id="do_type">
    <option value="del">批量删除</option>	
  </select>
  &nbsp;
  <input class=Button type="submit" name="Submit2" value="执行所选 的操作" onClick="return confirm('您确定执行该操作吗?')">
</div>
</form>
<div align="center">
  <form name="form1" method="post" action="" style="margin:0 0 0 0">
    <%n=currentpage+1
p=currentpage-1
if p>0then
response.write("["&"<a href='?"&urls&"&page="&cstr(p)&"'>上一页</a>]&nbsp;&nbsp;&nbsp;")
else response.write("上一页&nbsp;&nbsp;&nbsp;")
end if 
if (n-1)*recpage>=allrec then 
response.write("下一页" )
else
response.Write("["&"<a href='?"&urls&"&page="&cstr(n)&"'>下一页</a>]")
end if
response.write("&nbsp;共"&allrec&"条&nbsp;")
response.Write("&nbsp;共"&totalpage&"页&nbsp;")
response.Write("&nbsp;第"&currentpage&"页&nbsp;")
%>
    <input type="hidden" name="hid" value="<%=totalpage%>">
    &nbsp;&nbsp;跳至
    <input name="page" type="text" size="5" onChange="goto(this.form)" style="border:1px solid #000000;height:18px ">
    页
    <input type="button" name="Button22" value="Go->" style="font-size:12px ;border:1px solid #000000;height:18px ">
  </form>
</div>
<script type="text/javascript">
function ContraSel(form) {
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.name =='obj')
		e.checked=!e.checked;
	}
}
</script>
<%
end if
%>
</body>
</html>
<%
call connclose()
%>
