<?php
error_reporting(0);
global $db, $CcTvAi_com_userid;
if (!eregi($_SERVER['SERVER_NAME'], $_SERVER['HTTP_REFERER'])) {exit();}
close_browse();
if ($CcTvAi_com_userid) {
	$cd_uid=SafeRequest("uid", "post");
	if(!IsNumID($CcTvAi_com_userid)) {exit();}
	if(!IsNumID($cd_uid)) {exit();}
	$cd_type=SafeRequest("type", "post");
	$cd_month=SafeRequest("month", "post");
	if ($CcTvAi_com_userid==$cd_uid) {
		if ($cd_type) {
			if ($cd_month) {
				$db->query("delete from " . tname('notice') . " where cd_icon='" . $cd_type . "' and DateDiff(DATE(cd_addtime),'" . date('Y-m-d') . "')<=-30 and cd_uids='" . $cd_uid . "'");
			} else {
				$db->query("delete from " . tname('notice') . " where cd_icon='" . $cd_type . "' and cd_uids='" . $cd_uid . "'");
			}
		} else {
			if ($cd_month) {
				$db->query("delete from " . tname('notice') . " where DateDiff(DATE(cd_addtime),'" . date('Y-m-d') . "')<=-30 and cd_uids='" . $cd_uid . "'");
			} else {
				$db->query("delete from " . tname('notice') . " where cd_uids='" . $cd_uid . "'");
			}
		}
		exit('10000');
	} else {
		exit('20002');
	}
} else {
	exit('20001');
}
?>