/**
 * wpmlm_change_tax function, used through ajax and in normal page loading.
 * No parameters, returns nothing
 */
function wpmlm_change_tax()
{
    global $wpdb, $wpmlm_cart;
    $form_id = absint($_POST['form_id']);
    $wpmlm_selected_country = $wpmlm_cart->selected_country;
    $wpmlm_selected_region = $wpmlm_cart->selected_region;
    $wpmlm_delivery_country = $wpmlm_cart->delivery_country;
    $wpmlm_delivery_region = $wpmlm_cart->delivery_region;
    $previous_country = $_SESSION['wpmlm_selected_country'];
    if (isset($_POST['billing_country'])) {
        $wpmlm_selected_country = $_POST['billing_country'];
        $_SESSION['wpmlm_selected_country'] = $wpmlm_selected_country;
    }
    if (isset($_POST['billing_region'])) {
        $wpmlm_selected_region = absint($_POST['billing_region']);
        $_SESSION['wpmlm_selected_region'] = $wpmlm_selected_region;
    }
    $check_country_code = $wpdb->get_var($wpdb->prepare("SELECT `country`.`isocode` FROM `" . WPMLM_TABLE_REGION_TAX . "` AS `region` INNER JOIN `" . WPMLM_TABLE_CURRENCY_LIST . "` AS `country` ON `region`.`country_id` = `country`.`id` WHERE `region`.`id` = %d LIMIT 1", $_SESSION['wpmlm_selected_region']));
    if ($_SESSION['wpmlm_selected_country'] != $check_country_code) {
        $wpmlm_selected_region = null;
    }
    if (isset($_POST['shipping_country'])) {
        $wpmlm_delivery_country = $_POST['shipping_country'];
        $_SESSION['wpmlm_delivery_country'] = $wpmlm_delivery_country;
    }
    if (isset($_POST['shipping_region'])) {
        $wpmlm_delivery_region = absint($_POST['shipping_region']);
        $_SESSION['wpmlm_delivery_region'] = $wpmlm_delivery_region;
    }
    $check_country_code = $wpdb->get_var($wpdb->prepare("SELECT `country`.`isocode` FROM `" . WPMLM_TABLE_REGION_TAX . "` AS `region` INNER JOIN `" . WPMLM_TABLE_CURRENCY_LIST . "` AS `country` ON `region`.`country_id` = `country`.`id` WHERE `region`.`id` = %d LIMIT 1", $wpmlm_delivery_region));
    if ($wpmlm_delivery_country != $check_country_code) {
        $wpmlm_delivery_region = null;
    }
    $wpmlm_cart->update_location();
    $wpmlm_cart->get_shipping_method();
    $wpmlm_cart->get_shipping_option();
    if ($wpmlm_cart->selected_shipping_method != '') {
        $wpmlm_cart->update_shipping($wpmlm_cart->selected_shipping_method, $wpmlm_cart->selected_shipping_option);
    }
    $tax = $wpmlm_cart->calculate_total_tax();
    $total = wpmlm_cart_total();
    $total_input = wpmlm_cart_total(false);
    if ($wpmlm_cart->coupons_amount >= wpmlm_cart_total(false) && !empty($wpmlm_cart->coupons_amount)) {
        $total = 0;
    }
    if ($wpmlm_cart->total_price < 0) {
        $wpmlm_cart->coupons_amount += $wpmlm_cart->total_price;
        $wpmlm_cart->total_price = null;
        $wpmlm_cart->calculate_total_price();
    }
    ob_start();
    include_once wpmlm_get_template_file_path('wpmlm-cart_widget.php');
    $output = ob_get_contents();
    ob_end_clean();
    $output = str_replace(array("\n", "\r"), array("\\n", "\\r"), addslashes($output));
    if (get_option('lock_tax') == 1) {
        echo "jQuery('#current_country').val('" . esc_js($_SESSION['wpmlm_delivery_country']) . "'); \n";
        if ($_SESSION['wpmlm_delivery_country'] == 'US' && get_option('lock_tax') == 1) {
            $output = wpmlm_shipping_region_list($_SESSION['wpmlm_delivery_country'], $_SESSION['wpmlm_delivery_region']);
            $output = str_replace(array("\n", "\r"), array("\\n", "\\r"), addslashes($output));
            echo "jQuery('#region').remove();\n\r";
            echo "jQuery('#change_country').append(\"" . $output . "\");\n\r";
        }
    }
    foreach ($wpmlm_cart->cart_items as $key => $cart_item) {
        echo "jQuery('#shipping_{$key}').html(\"" . wpmlm_currency_display($cart_item->shipping) . "\");\n\r";
    }
    echo "jQuery('#checkout_shipping').html(\"" . wpmlm_cart_shipping() . "\");\n\r";
    echo "jQuery('div.shopping-cart-wrapper').html('{$output}');\n";
    if (get_option('lock_tax') == 1) {
        echo "jQuery('.shipping_country').val('" . esc_js($_SESSION['wpmlm_delivery_country']) . "') \n";
        $sql = $wpdb->prepare("SELECT `country` FROM `" . WPMLM_TABLE_CURRENCY_LIST . "` WHERE `isocode`= '%s'", $_SESSION['wpmlm_selected_country']);
        $country_name = $wpdb->get_var($sql);
        echo "jQuery('.shipping_country_name').html('" . $country_name . "') \n";
    }
    $form_selected_country = null;
    $form_selected_region = null;
    $onchange_function = null;
    if (!empty($_POST['billing_country']) && $_POST['billing_country'] != 'undefined' && !isset($_POST['shipping_country'])) {
        $form_selected_country = $wpmlm_selected_country;
        $form_selected_region = $wpmlm_selected_region;
        $onchange_function = 'set_billing_country';
    } else {
        if (!empty($_POST['shipping_country']) && $_POST['shipping_country'] != 'undefined' && !isset($_POST['billing_country'])) {
            $form_selected_country = $wpmlm_delivery_country;
            $form_selected_region = $wpmlm_delivery_region;
            $onchange_function = 'set_shipping_country';
        }
    }
    if ($form_selected_country != null && $onchange_function != null) {
        $region_list = $wpdb->get_results($wpdb->prepare("SELECT `" . WPMLM_TABLE_REGION_TAX . "`.* FROM `" . WPMLM_TABLE_REGION_TAX . "`, `" . WPMLM_TABLE_CURRENCY_LIST . "`  WHERE `" . WPMLM_TABLE_CURRENCY_LIST . "`.`isocode` IN('%s') AND `" . WPMLM_TABLE_CURRENCY_LIST . "`.`id` = `" . WPMLM_TABLE_REGION_TAX . "`.`country_id`", $form_selected_country), ARRAY_A);
        if ($region_list != null) {
            $title = empty($_POST['billing_country']) ? 'shippingstate' : 'billingstate';
            $output = "<select name='collected_data[" . $form_id . "][1]' class='current_region' onchange='{$onchange_function}(\"region_country_form_{$form_id}\", \"{$form_id}\");' title='" . $title . "'>\n\r";
            foreach ($region_list as $region) {
                if ($form_selected_region == $region['id']) {
                    $selected = "selected='selected'";
                } else {
                    $selected = "";
                }
                $output .= "   <option value='" . $region['id'] . "' {$selected}>" . htmlspecialchars($region['name']) . "</option>\n\r";
            }
            $output .= "</select>\n\r";
            $output = str_replace(array("\n", "\r"), array("\\n", "\\r"), addslashes($output));
            echo "jQuery('#region_select_{$form_id}').html(\"" . $output . "\");\n\r";
            echo "\n\t\t\t\tvar wpmlm_checkout_table_selector = jQuery('#region_select_{$form_id}').parents('.wpmlm_checkout_table').attr('class');\n\t\t\t\twpmlm_checkout_table_selector = wpmlm_checkout_table_selector.replace(' ','.');\n\t\t\t\twpmlm_checkout_table_selector = '.'+wpmlm_checkout_table_selector;\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' input.billing_region').attr('disabled', 'disabled');\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' input.shipping_region').attr('disabled', 'disabled');\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' .billing_region').parent().parent().hide();\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' .shipping_region').parent().parent().hide();\n\t\t\t";
        } else {
            if (get_option('lock_tax') == 1) {
                echo "jQuery('#region').hide();";
            }
            echo "jQuery('#region_select_{$form_id}').html('');\n\r";
            echo "\n\t\t\t\tvar wpmlm_checkout_table_selector = jQuery('#region_select_{$form_id}').parents('.wpmlm_checkout_table').attr('class');\n\t\t\t\twpmlm_checkout_table_selector = wpmlm_checkout_table_selector.replace(' ','.');\n\t\t\t\twpmlm_checkout_table_selector = '.'+wpmlm_checkout_table_selector;\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' input.billing_region').removeAttr('disabled');\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' input.shipping_region').removeAttr('disabled');\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' .billing_region').parent().parent().show();\n\t\t\t\tjQuery(wpmlm_checkout_table_selector + ' .shipping_region').parent().parent().show();\n\t\t\t";
        }
    }
    if ($tax > 0) {
        echo "jQuery(\"tr.total_tax\").show();\n\r";
    } else {
        echo "jQuery(\"tr.total_tax\").hide();\n\r";
    }
    echo "jQuery('#checkout_tax').html(\"<span class='pricedisplay'>" . wpmlm_cart_tax() . "</span>\");\n\r";
    echo "jQuery('#checkout_total').html(\"{$total}<input id='shopping_cart_total_price' type='hidden' value='{$total_input}' />\");\n\r";
    exit;
}
<?php

$key = get_current_user_key();
$userId = get_current_userid();
if (isset($key)) {
    include wpmlm_get_template_file_path('classes/wpmlm-my-dashboard.class.php');
    $objMyDashboard = new MyDashboard($key);
    $userDetail = $objMyDashboard->GetUserInfoById($userId);
    $totalBus = $objMyDashboard->TotalBusiness($userId);
    $myLeftArr = $objMyDashboard->MyTop5LeftLegMember($userId);
    $myRightArr = $objMyDashboard->MyTop5RightLegMember($userId);
    $myPerSalesArr = $objMyDashboard->MyTop5PersonalSales($userId);
    $payoutArr = $objMyDashboard->MyTop5PayoutDetails($userId);
    $myRightTotal = $objMyDashboard->MyRightLegMemberTotal($userId);
    $myLeftTotal = $objMyDashboard->MyLeftLegMemberTotal($userId);
    $myPerSalesTotal = $objMyDashboard->MyPersonalSalesTotal($userId);
    //echo "<pre>";print_r($myLeftArr); exit;
    global $current_user;
    get_currentuserinfo();
    $sponsor_name = $current_user->user_login;
    $reg_page_id = wpmlm_get_the_post_id_by_shortcode('[registration]');
    $affiliateURL = get_permalink($reg_page_id) . '&sp=' . $key;
}
?>
<div class="dashboard">
	<br />
	<p class="affiliate_url"><strong>Affiliate URL :</strong> <?php 
echo $affiliateURL;
?>
 </p>
	<div class="leftSide">
function wpmlm_show_categories($content)
{
    ob_start();
    include wpmlm_get_template_file_path('wpmlm-category-list.php');
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
<?php

$key = get_current_user_key();
if (isset($key) && $key != 'admin') {
    include wpmlm_get_template_file_path('classes/wpmlm-my-right-group-details.class.php');
    $objMyRight = new MyRight($key);
    $listArr = $objMyRight->MyRight($key);
    $totalRight = $objMyRight->MyRightLegMemberTotal($key);
    //echo "<pre>";print_r($listArr); exit;
} else {
    if (isset($key) && $key == 'admin') {
        echo "<div id='notlogin'>Sorry ! You are not a part of the Network</div>";
        die;
    } else {
        echo "<div id='notlogin'>Sorry ! You are not Logged in. Please Login youself to see the details</div>";
        die;
    }
}
?>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load('visualization', '1', {packages: ['table']});
</script>
<script type="text/javascript">
var visualization;
var data;

var options = {'showRowNumber': true};
function drawVisualization() {
  // Create and populate the data table.
  var dataAsJson =
function register_consultant()
{
    ob_start();
    include wpmlm_get_template_file_path('wpmlm-registration.php');
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}