<!--#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,f_recommend
recpage=20
dim lptypeid,lpareaid,infotypeid,title
if(request.QueryString("page")<>"") then
	currentpage=Clng(request.QueryString("page"))
else
	currentpage=1
end if
if(request.QueryString("lptypeid")<>"") then
	lptypeid=Clng(request.QueryString("lptypeid"))
else
	lptypeid=0
end if
if(request.QueryString("lpareaid")<>"") then
	lpareaid=Clng(request.QueryString("lpareaid"))	
else
	lpareaid=0
end if
if(request.QueryString("f_recommend")<>"") then
	f_recommend=Clng(request.QueryString("f_recommend"))	
else
	f_recommend=0
end if
title=request.queryString("title")
urls="lptypeid="&lptypeid&"&lpareaid="&lpareaid&"&title="&title&"&f_recommend="&f_recommend
%>
<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 ="?<%=urls%>&";
	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;
}</script>
<script language="JavaScript" type="text/JavaScript">

function ConfirmDel()
{
   if(confirm("确认删除？并且不能恢复！确定要删除此信息吗？"))
     return true;
   else
     return false;
	 
}
</script>
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style4 {color: #000000}
.style5 {color: #000000; 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" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td height="22" bgcolor="#FF9900"><div align="center"><span class="style1">◆ 楼盘信息管理 ◆</span></div></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="54%" height="22">
		<form name="form2" method="get" action="">
              <div align="center">
                <select name="lptypeid">
                  <option value="0">全部..</option>
                  <%=getResourceOption("t_lp_type",lptypeid)%>
                </select>
                <select name="lpareaid">
                  <option value="0">全部..</option>
                  <%=getResourceOption("t_lp_area",lpareaid)%>
                </select>
                <input name="title" type="text" value="<%=title%>">                  
                <select name="f_recommend" id="f_recommend">
                  <option value="0" <%if(f_recommend=0) then response.write("selected") end if%>>普通</option>
                  <option value="1" <%if(f_recommend=1) then response.write("selected") end if%>>推荐</option>
                </select>
                <input type="submit" name="Submit" value="搜 索">
              </div>
      </form>    </td>
  </tr>
</table>
<form action="lp_do.asp" method="post" name="mem" style="margin:0px; padding:0px;">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
      <tr>
        <td width="2%" bgcolor="#F5F5F5" class="style1"><div align="center" class="style4"></div></td>
        <td width="12%" height="22" bgcolor="#F5F5F5"><div align="center"><strong>楼盘名称[</strong>序号<strong>]</strong></div></td>
        <td width="10%" bgcolor="#F5F5F5"><div align="center"><strong>类别</strong></div></td>
        <td width="7%" bgcolor="#F5F5F5" class="style4"><div align="center"><strong>城区</strong></div></td>
        <td width="15%" bgcolor="#F5F5F5"><div align="center"><strong>开发商</strong></div></td>
        <td width="13%" bgcolor="#F5F5F5"><div align="center"><strong>日期</strong></div></td>
        <td width="8%" bgcolor="#F5F5F5" class="style4"><div align="center"><strong>生成HTM</strong></div></td>
        <td width="6%" bgcolor="#F5F5F5" class="style4"><div align="center" class="style4"><strong>修改</strong></div></td>
        <td width="5%" align="center" bgcolor="#F5F5F5" class="style4"><strong>动态</strong></td>
        <td width="7%" bgcolor="#F5F5F5" class="style4"><div align="center"><strong>历史价格</strong></div></td>
        <td width="7%" bgcolor="#F5F5F5" class="style5"><div align="center">户型图</div></td>
        <td width="8%" bgcolor="#F5F5F5" class="style5"><div align="center">楼盘图</div></td>
    </tr>
	  <%
		dim csql,qsql
		csql="select count(*) AS co from t_lp where 1=1"
		if(lptypeid>0) then
			csql=csql&" and LpTypeId="&lptypeid
		end if
		if(lpareaid>0) then
			csql=csql&" and LpAreaId="&lpareaid
		end if
		if(f_recommend>0) then
			csql=csql&" and f_recommend="&f_recommend
		end if
		if(title<>"") then
			csql=csql&" and title like '%"&title&"%'"
		end if
		qsql="select top "&recpage&" id,Title,f_price,f_kfs,f_type_title,f_area_title,f_sldh,f_date,f_sort from t_lp where id <=(select min(id) from (select top "&(recpage*(currentpage-1)+1)&" id from t_lp where 1=1"
		if(lptypeid>0) then
			qsql=qsql&" and LpTypeId="&lptypeid
		end if
		if(lpareaid>0) then
			qsql=qsql&" and LpAreaId="&lpareaid
		end if
		if(title<>"") then
			qsql=qsql&" and title like '%"&title&"%'"
		end if
		if(f_recommend>0) then
			qsql=qsql&" and f_recommend="&f_recommend
		end if
		qsql=qsql&" order by id desc) as t)"
		if(lptypeid>0) then
			qsql=qsql&" and LpTypeId="&lptypeid
		end if
		if(lpareaid>0) then
			qsql=qsql&" and LpAreaId="&lpareaid
		end if
		if(title<>"") then
			qsql=qsql&" and title like '%"&title&"%'"
		end if
		if(f_recommend>0) then
			qsql=qsql&" and f_recommend="&f_recommend
		end if
		qsql=qsql&" order by id desc "			
		'response.Write(qsql)
		''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	  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 i=0 to ubound(listArr,2)
	  %>
      <tr>
        <td bgcolor="#F7F7F7"><div align="center">
          <input type="checkbox" name="obj" value="<%=listArr(0,i)%>" />
        </div></td>
        <td height="20" bgcolor="#F7F7F7"><div align="left"><a href="../newhouse/show.asp?id=<%=listArr(0,i)%>" target="_blank"><%=listArr(1,i)%>[<%=listArr(8,i)%>]</a></div></td>
        <td bgcolor="#F7F7F7"><div align="center"><a href="../newhouse/show.asp?id=<%=listArr(0,i)%>" target="_blank"><%=listArr(4,i)%></a></div></td>
        <td bgcolor="#F7F7F7"><div align="center"><a href="../newhouse/show.asp?id=<%=listArr(0,i)%>" target="_blank"><%=listArr(5,i)%></a></div></td>
        <td bgcolor="#F7F7F7"><a href="../lp/show.asp?id=<%=listArr(0,i)%>" target="_blank"><%=listArr(3,i)%></a></td>
        <td bgcolor="#F7F7F7"><div align="center"><%=listArr(7,i)%></div></td>
        <td bgcolor="#F7F7F7"><div align="center"><a href="lp_reset.asp?id=<%=listArr(0,i)%>">生成-&gt;</a></div></td>
        <td bgcolor="#F7F7F7"><div align="center"><a href="lp_mod.asp?lp_id=<%=listArr(0,i)%>">修改</a></div></td>
        <td align="center" bgcolor="#F7F7F7"><a href="lp_news.asp?lp_id=<%=listArr(0,i)%>">管理</a></td>
        <td bgcolor="#F7F7F7"><div align="center"><a href="lp_hisprice.asp?lp_id=<%=listArr(0,i)%>">管理</a></div></td>
        <td bgcolor="#F7F7F7"><div align="center"><a href="lp_hx.asp?lp_id=<%=listArr(0,i)%>">管理</a></div></td>
        <td bgcolor="#F7F7F7"><div align="center"><a href="lp_photo.asp?lp_id=<%=listArr(0,i)%>">管理</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>	
	<option value="recommend">批量推荐</option>
	<option value="unrecommend">取消推荐</option>
  <option value="weekpk">设置本周PK</option>
  </select>
  &nbsp;
  <input class=Button type="submit" name="Submit2" value="执行所选 的操作" onClick="return confirm('您确定执行该操作吗?')">
</div>
</form>
<div align="center">
  <form name="pageform" id="pageform" 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(document.pageform)" 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>
</body>
</html>
<%
call connclose()
%>
