Example #1
0
    include "../fbd.php";
    exit;
}
$action = trim($_POST['action']);
$tr_id = intval($_REQUEST['transaction_id']);
if ($action == 'buy') {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/paid_advices.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/exrates.php";
    $exrates = new exrates();
    $EXR = $exrates->GetAll();
    $paid_advice = new paid_advices();
    $id_advice = intval($_POST['id_advice']);
    $advice = $paid_advice->getAdvice($id_advice);
    if ((int) $advice['id'] <= 0) {
        header("Location: /bill/fail/");
        exit;
    }
    $sum = round($advice['comm_sum'] / $EXR[13], 2);
    $order_id = $paid_advice->payedAdvice($advice['id'], $advice['user_to'], $tr_id, $sum, $advice['comm_sum']);
    if ($advice['converted_id'] > 0 && $order_id) {
        require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/opinions.php";
        opinions::DeleteMsg($advice['user_from'], $advice['converted_id']);
    }
}
if (!$order_id) {
    header("Location: /bill/fail/");
    exit;
} else {
    header("Location: /bill/success/");
    exit;
}
Example #2
0
     }
 
     if (!$error_flag && 0 == opinions::CheckUserCanPost($uid, $user->uid)) {
         $error .= opinions::NewMsg($uid, $user->uid, $theme, $rating, getRemoteIP());
     }
 
     if (!$error && !$error_flag) {
         unset($theme);
         unset($action);
     }
     break;
 */
 case "delete":
     $id = intval(trim($_GET['msg']));
     if ($id && $uid) {
         $error = opinions::DeleteMsg($uid, $id, hasPermissions('users'));
     }
     //header("Location: /blogs/viewgroup.php?gr=$gr&t=$t");
     break;
 case "delete_com":
     $id = intval(trim($_GET['msg']));
     if ($id && $uid) {
         $error = opinions::deleteComment($id, $uid, hasPermissions('users'));
     }
     break;
 case "cmtopinion":
     $id = intval($_POST['opid']);
     $theme = substr(change_q_x($_POST['comment'], false, false, 'br|b|i'), 0, 3000);
     if (!$uid) {
         $com_error_flag = 1;
     }
Example #3
0
function DeleteOpinion($op_id, $from = 'frl')
{
    @session_start();
    $op_id = intval($op_id);
    $objResponse = new xajaxResponse();
    $msg = opinions::GetMessageById($op_id);
    $old_rating = $msg['rating'];
    if (get_uid(0) == $msg['fromuser_id'] || hasPermissions('users')) {
        $error = opinions::DeleteMsg($msg['fromuser_id'], $op_id, hasPermissions('users'));
    } else {
        $error = 'Вы не можете удалить мнение об этом пользователе.';
    }
    if (!$error) {
        //$user = new users();
        //$user->GetUserByUID($_SESSION['page_user_id']);
        $ot = $old_rating == 1 ? 'plus' : ($old_rating == -1 ? 'minus' : 'neitral');
        $objResponse->call('opinionChConuters', 'ops-' . $from . $ot);
        ///?????
        $objResponse->remove("opinion_{$op_id}");
        //$objResponse->remove("opid_$op_id");
        //$objResponse->remove("form_container");
        // @deprecated #0015627
        // $objResponse->prepend("messages_container","innerHTML",  opinions::printAddForm(get_uid(false),$msg['touser_id'],$from));
        //$objResponse->call('opinionsFormBtns');
    } else {
        $objResponse->script("alert('{$error}')");
    }
    return $objResponse;
}