<?php

 
$conf_basedir	= "../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
checkAuth('49');	//判断登录和权限
 
$allow_act = array("head", "cert", "real", "account");
if(!in_array($act, $allow_act))  die('参数错误');
 
if(is_array($stat) && !empty($stat)){
	$piccheck = new QaBrokerCheck($act);
	foreach($stat as $key=>$val){
		$oper = intval($val);
		if($oper == 1){	//通过
			$piccheck->thaw($id[$key],$admin[$key]);
		}elseif($oper == 2) {//不通过
			$piccheck->nothaw($id[$key],$admin[$key]);
		}
	}
}
 
sleep(1);
echo "<script>window.location.href='./cert_manage.php?act=".$act."';</script>";
exit;

//经纪人QA图片审核
class QaBrokerCheck{
	private $systime = '';
	private $act = '';

	public function __construct($act){
		$this->systime = time();
		$this->act = $act;
	}

	
	private function delPicFromQaTable($id){
		global $db;
		$sql = "delete from admin_broker_qa where id = '".$id."'";
		$db->Execute($sql);
	}

	public function thaw($id,$admin){  
		$this->delPicFromQaTable($id);
		add2BrokerQaStat($this->act, 'pass', $admin);
	}

	public function nothaw($id,$admin){    
	    $this->delPicFromQaTable($id);
		add2BrokerQaStat($this->act, 'no', $admin);
	}
}
?>