<?php
error_reporting(0);
close_browse();
if (!eregi($_SERVER['SERVER_NAME'], $_SERVER['HTTP_REFERER'])) {exit();}
global $db, $CcTvAi_com_userid;
if ($CcTvAi_com_userid) {
	$specialid=SafeRequest("specialid", "post");
	$joinlist=RequestBox("joinlist");
	$dellist=RequestBox("dellist");
	if(!IsNumID($CcTvAi_com_userid)) {exit();}
	if (submitcheck('join')) {
		$db->query("update " . tname('dj') . " set CD_SpecialID='" . $specialid . "' where CD_ID in ($joinlist)");
		//$db->query('update ' . tname('malbum') . " set CD_Song='" . $joinlist . "' where CD_ID=" . $specialid . "");
		header("Location:" . $_SERVER['HTTP_REFERER']);
	} elseif (submitcheck('del')) {
		$db->query("update " . tname('dj') . " set CD_SpecialID=0 where CD_ID in ($dellist)");
		//$db->query('update ' . tname('malbum') . " set CD_Song='" . $dellist . "' where CD_ID=" . $specialid . "");
		header("Location:" . $_SERVER['HTTP_REFERER']);
	} else {
		echo "<script type=\"text/javascript\">window.location='" . $_SERVER['HTTP_REFERER'] . "'</script>";
	}
} else {
	echo "<script type=\"text/javascript\">window.location='" . $_SERVER['HTTP_REFERER'] . "'</script>";
}
?>