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

if(is_array($idarr) && !empty($idarr))
{
	$remarkcheck = new QaRemarkCheck('remark');
	foreach($idarr as $id)
	{
		$oper = intval($operarr[$id]);

		if($oper == 1)	//冻结
		{
			$remarkcheck->nothaw($id);
		}
		else //通过
		{
			$remarkcheck->thaw($id);
		}
	}
}

sleep(1);
echo "<script>window.location.href='./remark_manage.php';</script>";
exit;

//QA图片审核
class QaRemarkCheck
{
	private $systime = '';
	private $act = '';

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

	private function getInfoFromQaTable($id)
	{
		global $dbback;
		
		$return = array();

		$sql = "select admin from admin_remark_qa where id = '".$id."'";
		$return = $dbback->GetRow($sql);

		return $return;
	}
	
	private function delRemarkFromQaTable($id)
	{
		global $db;

		$sql = "delete from admin_remark_qa where id = '".$id."'";
		$db->Execute($sql);
	}

	public function thaw($id)
	{
		$info = $this->getInfoFromQaTable($id);
		$this->delRemarkFromQaTable($id);
		add2QaStat($this->act, 'pass', $info['admin']);
	}

	public function nothaw($id)
	{
		$info = $this->getInfoFromQaTable($id);
		$this->delRemarkFromQaTable($id);
		
		add2QaStat($this->act, 'no', $info['admin']);
	}
}
?>