<?php
if (!defined('MOD')) die("access die");
$sid = intval($_GET['sid']);
$aid = trim($_GET['aid']);
checkAdminReferer();
if ($sid >0 && $aid)
{
	$aids = explode(',', $aid);
	for( $i=0; $i<count($aids); $i++)
	{
		if( ($aids[$i] = intval($aids[$i])) === 0)
		{
			unset($aids[$i]);
		}
	}
	$aid  = implode(',', $aids);
	$sql  = "delete from ".TABLEPRE."{$_MODULE[$channelselect][table_name]}_{$channelid}_special where sid='$sid' and aid IN (".$aid.") ";
	if ( qdb::Query( $sql, true) > 0)
	{
		$data = array( 'status'=>200 );
		header("x-json: " . qbase::jsonencode($data));
	}
	else
	{
		$data = array( 'status'=>500 );
		header("x-json: " . qbase::jsonencode($data));
	}
}
else
{
	$data = array( 'status'=>417 );
	header("x-json: " . qbase::jsonencode($data));
}
exit();
?>