Exemplo n.º 1
0
function DeleteAdvice($id_advice)
{
    $objResponse = new xajaxResponse();
    $id_advice = intval($id_advice);
    if (!$id_advice) {
        $objResponse->call('alert', 'Ошибка');
        return $objResponse;
    }
    $advice = new paid_advices();
    $info = $advice->getAdviceById($id_advice);
    if ($info['converted_id'] > 0) {
        require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/opinions.php";
        opinions::setConvertOpinion($info['converted_id'], null);
    }
    $advice->delete($id_advice);
    $html = 'Рекомендация удалена.';
    $objResponse->call("adviceRespBlockDel", $id_advice, $html);
    return $objResponse;
}