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

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

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

//过滤正在审核的
$idarr = getCheckRowidByType("remark_qa");
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_qa WHERE ".$wherecond;
$numrows = $dbback->GetOne($sql);

//获得数据当前页面数据
$sql = "SELECT * FROM admin_remark_qa 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']."' ", "address, price, buildarea $priceunitsql");

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

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