<?php
error_reporting(0);
global $db, $CcTvAi_com_userid;
if(!eregi($_SERVER['SERVER_NAME'], $_SERVER['HTTP_REFERER'])) {
    exit();
}
close_browse();
$callback=SafeRequest("callback", "get");
$did=SafeRequest("did", "get");
if($CcTvAi_com_userid) {
    global $db;
    $sql="select * from " . tname('pay') . " where cd_uid='$CcTvAi_com_userid' and cd_id='$did'";
    if($row=$db->getrow($sql)) {
        $db->query("delete from " . tname('pay') . " where cd_uid='$CcTvAi_com_userid' and cd_id='$did'");
        exit($callback . '({"error":004})');
    } else {
        exit($callback . '({"error":003})');
    }
} else {
    exit($callback . '({"error":001})');
}
?>