<?php
$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
checkAuth('17');	//判断登录和权限

$js = "<script type='text/javascript' src='http://esfadmin.house365.com/script/js/showremark.js'></script>";

//查询条件
$wherecond = "";

//过滤正在审核的
$idarr = getCheckRowidByType("remark_check");
if(is_array($idarr) && !empty($idarr))
{
	$notidsql = "";
	foreach($idarr as $val)
	{
		$id = intval($val);
		$notidsql .= $notidsql != "" ? " AND id != ".$id." " : " id != ".$id." ";
	}

	$wherecond .= " ".$notidsql." ";
}
else
{
	$wherecond = " 1 ";
}


//分页参数
$pagesize = 10;

//获得数据总条数
$sql = "SELECT COUNT(*) FROM admin_remark_check WHERE ".$wherecond;
$numrows = $dbback->GetOne($sql);

//获得数据当前页面数据
$sql = "SELECT * FROM admin_remark_check WHERE $wherecond ORDER BY id ASC LIMIT ".$pagesize." ";
$data_info = $dbback->GetAll($sql);

//设置正在审核记录
if($data_info)
{
	$idarr = $houseinfo = array();
	foreach($data_info as $key=>$data)
	{
		$idarr[] = $data['id'];
		if($data['housetbl'] == "sell" || $data['housetbl'] == "rent"){
			$priceunitsql = $data['housetbl'] == 'rent' ? ",priceunit" : "";
			$houseinfo[$key] = $dao->getRow($data['housetbl'], " id = '".$data['houseid']."' ", "esta, address, price, buildarea $priceunitsql");

			$unitarr = array('1'=>'元/月','2'=>'元/天*平方米','3'=>'元/月*平方米');
			$unit[$key] = $data['housetbl'] == 'rent' ? $unitarr[$houseinfo[$key]['priceunit']] : "万";
		}
	}
	resetCheckLog("remark_check", $idarr);
}


$title = "经纪人房源描述审核&nbsp;&nbsp;剩余（".$numrows."）条";
//引用模版文件
include_once(Template("header"));
include_once(Template("broker_house/remark_manage"));
include_once(Template("footer"));
?>