<?php

$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
checkAuth('79');	//判断登录和权限
//$x = new BlockLevelStat();
//$x->flushHeat();
$title = "小区等级设置";
$request  = new Request();

$blockLevelHeatSetting = new BlockLevelHeatSetting();
//echo $blockLevelHeatSetting->getExpWayAlias('A');
//print_r($data_info);
//xdebug_var_dump($data_info);
//echo xdebug_time_index();
//echo xdebug_memory_usage();
if($request->isAjax()) {
    $pv = intval($_POST['pv']);
    $houseNumber = intval($_POST['house_number']);
    $number = $blockLevelHeatSetting->update($pv,$houseNumber);
    if($number==4) {
        //写操作日志
        $operateRecord->insertData('79', 'update', 
                '更新小区等级设置的pv值为'.$pv.'和房源数量为'.$houseNumber.'成功', $_SESSION['esfadmin']['username']);
        echo json_encode(array('result'=>1));
    }else {
        //写操作日志
        $operateRecord->insertData('79', 'update', 
                '更新小区等级设置的pv值为'.$pv.'和房源数量为'.$houseNumber.'失败', $_SESSION['esfadmin']['username']);
        echo json_encode(array('result'=>0));
    }
    exit;
} else {
    $data_info = $blockLevelHeatSetting->findAll();
    include_once(Template("header"));
    include_once(Template("growth/block_level_heat_setting"));
    include_once(Template("footer"));
}



?>
