<?php

require_once '../../../wp-config.php';
$g_criteria = "";
$g_criteria1 = "";
$g_criteria2 = "";
$g_criteria3 = "";
if (isset($_REQUEST['do'])) {
    $g_criteria1 = trim($_REQUEST['do']);
}
if (isset($_REQUEST['event'])) {
    $g_criteria2 = trim($_REQUEST['event']);
}
switch ($g_criteria1) {
    case "statuschange":
        updatePaymentStatus($_REQUEST['userId'], $_REQUEST['status']);
        insert_refferal_commision($_REQUEST['userId']);
        echo $output = !empty($_REQUEST['status']) ? $_REQUEST['name'] : '';
        break;
}
Exemplo n.º 2
0
function handleUpdatePaymentStatus($entity)
{
    updatePaymentStatus($entity);
}
Exemplo n.º 3
0
<?php

require_once '../../../wp-config.php';
$g_criteria = "";
$g_criteria1 = "";
$g_criteria2 = "";
$g_criteria3 = "";
if (isset($_REQUEST['do'])) {
    $g_criteria1 = trim($_REQUEST['do']);
}
if (isset($_REQUEST['event'])) {
    $g_criteria2 = trim($_REQUEST['event']);
}
switch ($g_criteria1) {
    case "statuschange":
        updatePaymentStatus();
        //insert_refferal_commision();
        break;
}
function updatePaymentStatus()
{
    global $wpdb, $table_prefix;
    if (isset($_REQUEST['userId']) && isset($_REQUEST['status'])) {
        if ($_REQUEST['status'] == '0') {
            $sql = "UPDATE {$table_prefix}mlm_users  SET `payment_status` = '0' WHERE user_id = '" . $_REQUEST['userId'] . "'";
            $wpdb->query($sql);
            $uID = $wpdb->get_var("SELECT id FROM {$table_prefix}mlm_users WHERE user_id='" . $_REQUEST['userId'] . "'");
            $sql = "UPDATE {$table_prefix}mlm_payment_status  SET `payment_status` = '0' WHERE user_id = '" . $uID . "'";
            $wpdb->query($sql);
        } else {
            UserStatusUpdate($_REQUEST['userId']);