当前位置: 首页>>代码示例>>PHP>>正文


PHP mlm_core_get_table_prefix函数代码示例

本文整理汇总了PHP中mlm_core_get_table_prefix函数的典型用法代码示例。如果您正苦于以下问题:PHP mlm_core_get_table_prefix函数的具体用法?PHP mlm_core_get_table_prefix怎么用?PHP mlm_core_get_table_prefix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mlm_core_get_table_prefix函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insert_refferal_commision

function insert_refferal_commision()
{
    global $wpdb;
    $date = date("Y-m-d H:i:s");
    $child_ids = '';
    $mlm_payout = get_option('wp_mlm_payout_settings');
    $refferal_amount = $mlm_payout['referral_commission_amount'];
    $table_prefix = mlm_core_get_table_prefix();
    if (isset($_REQUEST['userId']) && $_REQUEST['status'] == 1) {
        $table_prefix = mlm_core_get_table_prefix();
        $user_id = $_REQUEST['userId'];
        $row = $wpdb->get_row("SELECT * FROM {$table_prefix}mlm_users WHERE user_id={$user_id}");
        $sponsor_key = $row->sponsor_key;
        $child_id = $row->id;
        if ($sponsor_key != 0) {
            $sponsor = $wpdb->get_row("SELECT id FROM {$table_prefix}mlm_users WHERE user_key='" . $sponsor_key . "'");
            $sponsor_id = $sponsor->id;
            $sql = "INSERT INTO {$table_prefix}mlm_referral_commission SET date_notified ='{$date}',sponsor_id='{$sponsor_id}',child_id='{$child_id}',amount='{$refferal_amount}',payout_id='0'";
            $rs = $wpdb->query($sql);
            if (!$rs) {
                _e("<span class='error' style='color:red'>Inserting  Fail</span>");
            }
        }
    }
}
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:25,代码来源:ajaxFunction.php

示例2: mlmePinUpdate

function mlmePinUpdate()
{
    $mlm_settings = get_option('wp_mlm_general_settings');
    if (isset($mlm_settings['ePin_activate']) && $mlm_settings['ePin_activate'] == '1') {
        global $wpdb;
        global $current_user;
        $user_id = $current_user->ID;
        $table_prefix = mlm_core_get_table_prefix();
        $user = get_userdata($user_id);
        $user_key = $wpdb->get_var("select user_key from {$table_prefix}mlm_users where user_id='{$user->ID}'");
        /* check that it is mlm user or not */
        $res = $wpdb->get_row("SELECT epin_no FROM {$table_prefix}mlm_epins WHERE user_key = '" . $user_key . "'");
        $path = "'" . plugins_url() . "/" . MLM_PLUGIN_NAME . "'";
        if ($wpdb->num_rows > 0) {
            $payment_status = $wpdb->get_var("select payment_status from {$table_prefix}mlm_users where user_id='{$user->ID}'");
            if ($payment_status == '1') {
                echo '<div style="background:#FFCC99;padding:10px;">' . __('Your status is already to set to Paid in the system. You cannot activate your membership again with an ePin.', 'binary-mlm-pro') . '</div>';
            } else {
                if ($payment_status == '2') {
                    echo '<div style="background:#FFCC99;padding:10px;">' . __('Your status is already set to Active in the system. You cannot activate your membership again with an ePin.', 'binary-mlm-pro') . '</div>';
                }
            }
        } else {
            $not_mlm = $wpdb->get_row("select id from {$table_prefix}mlm_users where user_id='{$user->ID}'");
            if ($wpdb->num_rows == '0') {
                echo '<div style="background:#FFCC99;padding:10px;">' . __('Not MLM User', 'binary-mlm-pro') . '</div>';
            } else {
                $payment_status = $wpdb->get_var("select payment_status from {$table_prefix}mlm_users where user_id='{$user->ID}'");
                if ($payment_status == '1') {
                    echo '<div style="background:#FFCC99;padding:10px;">' . __('Your status is already to set to Paid in the system. You cannot activate your membership again with an ePin.', 'binary-mlm-pro') . '</div>';
                } else {
                    if ($payment_status == '2') {
                        echo '<div style="background:#FFCC99;padding:10px;">' . __('Your status is already set to Active in the system. You cannot activate your membership again with an ePin.', 'binary-mlm-pro') . '</div>';
                    } else {
                        $epin = '<input type="text" name="epin" id="epin_' . $user_id . '"><input type="button" value="Update ePin" id="update_' . $user_id . '" onclick="setePinUser(' . $path . ',' . $user_id . ',document.getElementById(\'epin_' . $user_id . '\').value);"><span id="epinmsg_' . $user_id . '"></span>';
                        echo $epin;
                    }
                }
            }
        }
    } else {
        echo '<div style="background:#FFCC99;padding:10px;">' . __('Sorry. You are not allowed to access this page due to administrative permissions.', 'binary-mlm-pro') . '</div>';
    }
}
开发者ID:EvandroEpifanio,项目名称:binary-mlm-pro,代码行数:44,代码来源:mlm-epin-update.php

示例3: mlm_payment_status_details_page

function mlm_payment_status_details_page()
{
    global $wpdb;
    $table_prefix = mlm_core_get_table_prefix();
    $error = '';
    $chk = 'error';
    $mlm_method = get_option('wp_mlm_payment_method');
    if ($mlm_method['mlm_payment_method'] == 'paypal') {
        if ($_POST["payment_status"] == 1) {
            $paymentStatus = 1;
        } else {
            $paymentStatus = 0;
        }
        $OrderID = $_POST["item_number"];
    } else {
        if ($mlm_method['mlm_payment_method'] == 'cardsave') {
            //echo "<pre>"; print_r($_POST); exit;
            $mlm_pay_settings = get_option('wp_mlm_payment_settings');
            $PreSharedKey = $mlm_pay_settings["mlm-pre-shared-key"];
            $MerchantID = $mlm_pay_settings["mlm-merchant-id"];
            $Password = $mlm_pay_settings["mlm-merchant-password"];
            $OrderID = $_POST["OrderID"];
            //magic quotes fix
            if (get_magic_quotes_gpc()) {
                $_POST = array_map('stripslashes', $_POST);
            }
            //Generate Hashstring - use combination of post variables and variables from config.php
            $HashString = "PreSharedKey=" . $PreSharedKey;
            $HashString = $HashString . '&MerchantID=' . $_POST["MerchantID"];
            $HashString = $HashString . '&Password=' . $Password;
            $HashString = $HashString . '&StatusCode=' . $_POST["StatusCode"];
            $HashString = $HashString . '&Message=' . $_POST["Message"];
            $HashString = $HashString . '&PreviousStatusCode=' . $_POST["PreviousStatusCode"];
            $HashString = $HashString . '&PreviousMessage=' . $_POST["PreviousMessage"];
            $HashString = $HashString . '&CrossReference=' . $_POST["CrossReference"];
            $HashString = $HashString . '&AddressNumericCheckResult=' . $_POST["AddressNumericCheckResult"];
            $HashString = $HashString . '&PostCodeCheckResult=' . $_POST["PostCodeCheckResult"];
            $HashString = $HashString . '&CV2CheckResult=' . $_POST["CV2CheckResult"];
            $HashString = $HashString . '&ThreeDSecureAuthenticationCheckResult=' . $_POST["ThreeDSecureAuthenticationCheckResult"];
            $HashString = $HashString . '&CardType=' . $_POST["CardType"];
            $HashString = $HashString . '&CardClass=' . $_POST["CardClass"];
            $HashString = $HashString . '&CardIssuer=' . $_POST["CardIssuer"];
            $HashString = $HashString . '&CardIssuerCountryCode=' . $_POST["CardIssuerCountryCode"];
            $HashString = $HashString . '&Amount=' . $_POST["Amount"];
            $HashString = $HashString . '&CurrencyCode=' . $_POST["CurrencyCode"];
            $HashString = $HashString . '&OrderID=' . $OrderID;
            $HashString = $HashString . '&TransactionType=' . $_POST["TransactionType"];
            $HashString = $HashString . '&TransactionDateTime=' . $_POST["TransactionDateTime"];
            $HashString = $HashString . '&OrderDescription=' . $_POST["OrderDescription"];
            $HashString = $HashString . '&CustomerName=' . $_POST["CustomerName"];
            $HashString = $HashString . '&Address1=' . $_POST["Address1"];
            $HashString = $HashString . '&Address2=' . $_POST["Address2"];
            $HashString = $HashString . '&Address3=' . $_POST["Address3"];
            $HashString = $HashString . '&Address4=' . $_POST["Address4"];
            $HashString = $HashString . '&City=' . $_POST["City"];
            $HashString = $HashString . '&State=' . $_POST["State"];
            $HashString = $HashString . '&PostCode=' . $_POST["PostCode"];
            $HashString = $HashString . '&CountryCode=' . $_POST["CountryCode"];
            $HashString = $HashString . '&EmailAddress=' . $_POST["EmailAddress"];
            $HashString = $HashString . '&PhoneNumber=' . $_POST["PhoneNumber"];
            //Encode HashDigest using SHA1 encryption (and create HashDigest for later use) - This is used as a checksum to ensure that the form post from the gateway back to this page hasn't been tampered with.
            $HashDigest = sha1($HashString);
            if ($_POST["StatusCode"] == 0) {
                $paymentStatus = 1;
            } else {
                $paymentStatus = 0;
            }
        }
    }
    //print $HashString;
    if ($paymentStatus == 1) {
        $user_id = $wpdb->get_var("SELECT user_id FROM {$table_prefix}mlm_payment_status  WHERE `order_id`='" . $OrderID . "'");
        $user_child = $wpdb->get_var("SELECT user_id FROM {$table_prefix}mlm_users  WHERE `id`='" . $user_id . "'");
        //get no. of level
        UserStatusUpdate($user_child);
        //}  //end of for loop
        $msg = "<span style='color:green;'>Thank you. Your payment has been processed successfully.<a href=''>Click here</a> to go your Dashboard.</span>";
        _e($msg);
    } else {
        $msg = "<span style='color:red;'>Sorry. There was an error processing your payment. <a href=''>Click here</a> to go your Dashboard.</span>";
        _e($msg);
    }
}
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:83,代码来源:mlm-payment-process.php

示例4: my_show_extra_profile_fields

function my_show_extra_profile_fields($user)
{
    global $wpdb;
    $table_prefix = mlm_core_get_table_prefix();
    include 'js-validation-file.html';
    ?>

    <script type="text/javascript">
        var popup1, popup2, splofferpopup1;
        var bas_cal, dp_cal1, dp_cal2, ms_cal; // declare the calendars as global variables 
        window.onload = function() {
            dp_cal1 = new Epoch('dp_cal1', 'popup', document.getElementById('user_dob'));
        };
    </script>
    <h3>Extra profile information</h3>

    <table class="form-table">
        <tr>
            <th><label for="user_address1">Address1 <span class="description">(required)</span></label></th>
            <td>
                <input type="text" name="user_address1" id="user_address1" value="<?php 
    _e(esc_attr(get_the_author_meta('user_address1', $user->ID)));
    ?>
" class="regular-text" required = true /><br />
                <!-- <span class="description">You edit here your address.</span>  -->
            </td>
        </tr>

        <tr>
            <th><label for="user_address2">Address2</label></th>
            <td>
                <input type="text" name="user_address2" id="user_address2" value="<?php 
    _e(esc_attr(get_the_author_meta('user_address2', $user->ID)));
    ?>
" class="regular-text" /><br />
                <!-- <span class="description">Please edit here your address.</span> -->
            </td>
        </tr>

        <tr>
            <th><label for="user_city">City <span class="description">(required)</span></label></th>
            <td>
                <input type="text" name="user_city" id="user_city" value="<?php 
    _e(esc_attr(get_the_author_meta('user_city', $user->ID)));
    ?>
" class="regular-text" required = true /><br />
                <!-- <span class="description">Please edit here your address.</span> -->
            </td>
        </tr>

        <tr>
            <th><label for="user_state">State <span class="description">(required)</span></label></th>
            <td>
                <input type="text" name="user_state" id="user_state" value="<?php 
    _e(esc_attr(get_the_author_meta('user_state', $user->ID)));
    ?>
" class="regular-text" required = true /><br />
                <!-- <span class="description">Please edit here your address.</span> -->
            </td>
        </tr>

        <tr>
            <th><label for="user_postalcode">Postal Code <span class="description">(required)</span></label></th>
            <td>
                <input type="text" name="user_postalcode" id="user_postalcode" value="<?php 
    _e(esc_attr(get_the_author_meta('user_postalcode', $user->ID)));
    ?>
" class="regular-text" required = true /><br />
                <!-- <span class="description">Please edit here your address.</span> -->
            </td>
        </tr>

        <tr>
            <th><label for="user_country">Country <span class="description">(required)</span></label></th>
            <td>
                <?php 
    $sql = "SELECT name\n\t\t\t\t\t\t\tFROM {$table_prefix}mlm_country\n\t\t\t\t\t\t\tORDER BY name";
    $results = $wpdb->get_results($sql);
    ?>
                <select name="user_country" id="user_country" required = true >
                    <option value="">Select Country</option>
                    <?php 
    foreach ($results as $row) {
        if (esc_attr(get_the_author_meta('user_country', $user->ID)) == $row->name) {
            $selected = 'selected';
        } else {
            $selected = '';
        }
        ?>
                        <option value="<?php 
        echo $row->name;
        ?>
" <?php 
        echo $selected;
        ?>
><?php 
        echo $row->name;
        ?>
</option>
                        <?php 
//.........这里部分代码省略.........
开发者ID:EvandroEpifanio,项目名称:binary-mlm-pro,代码行数:101,代码来源:admin-user-update-profile.php

示例5: myLeftGroupDetails

function myLeftGroupDetails($id = '')
{
    $table_prefix = mlm_core_get_table_prefix();
    global $wpdb;
    //get loged user's key
    if ($id == '') {
        $key = get_current_user_key();
    } else {
        $key = $wpdb->get_var("SELECT user_key FROM {$table_prefix}mlm_users WHERE user_id = {$id}");
    }
    //Total Users on My left leg
    $leftLegUsers = totalLeftLegUsers($key);
    //paid users on my left leg
    $leftLegActiveUsers = activeUsersOnLeftLeg($key);
    //show total users on left leg
    $totalLeftLegUsers = myTotalLeftLegUsers($key);
    //_e("<pre>");print_r($totalLeftLegUsers);exit;
    ?>
    <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 =
                    {cols: [
                            {id: 'A', label: '<?php 
    echo _e("User Name", "binary-mlm-pro");
    ?>
', type: 'string'},
                            {id: 'B', label: '<?php 
    echo _e("User Key", "binary-mlm-pro");
    ?>
 ', type: 'string'},
                            {id: 'C', label: '<?php 
    echo _e("Sponsor", "binary-mlm-pro");
    ?>
', type: 'string'},
                            {id: 'D', label: '<?php 
    echo _e("Status", "binary-mlm-pro");
    ?>
', type: 'string'}],
                        rows: [
    <?php 
    foreach ($totalLeftLegUsers as $row) {
        ?>
                                {c: [{v: '<?php 
        echo $row['username'];
        ?>
'}, {v: '<?php 
        echo $row['user_key'];
        ?>
'}, {v: '<?php 
        echo $row['sponsor_key'];
        ?>
'}, {v: '<?php 
        echo $row['payment_status'];
        ?>
'}]},
    <?php 
    }
    ?>
                        ]};
            data = new google.visualization.DataTable(dataAsJson);
            // Set paging configuration options
            // Note: these options are changed by the UI controls in the example.
            options['page'] = 'enable';
            options['pageSize'] = 10;
            options['pagingSymbols'] = {prev: 'prev', next: 'next'};
            options['pagingButtonsConfiguration'] = 'auto';
            //options['allowHtml'] = true;
            //data.sort({column:1, desc: false});
            // Create and draw the visualization.
            visualization = new google.visualization.Table(document.getElementById('table'));
            draw();
        }
        function draw() {
            visualization.draw(data, options);
        }
        google.setOnLoadCallback(drawVisualization);
        // sets the number of pages according to the user selection.
        function setNumberOfPages(value) {
            if (value) {
                options['pageSize'] = parseInt(value, 10);
                options['page'] = 'enable';
            } else {
                options['pageSize'] = null;
                options['page'] = null;
            }
            draw();
        }
        // Sets custom paging symbols "Prev"/"Next"
        function setCustomPagingButtons(toSet) {
            options['pagingSymbols'] = toSet ? {next: 'next', prev: 'prev'} : null;
            draw();
        }
//.........这里部分代码省略.........
开发者ID:EvandroEpifanio,项目名称:binary-mlm-pro,代码行数:101,代码来源:mlm-left-group-details.php

示例6: mlmRoyaltyBonus

function mlmRoyaltyBonus()
{
    //get database table prefix
    $table_prefix = mlm_core_get_table_prefix();
    $error = '';
    $chk = 'error';
    //get no. of level
    $mlm_general_settings = get_option('wp_mlm_general_settings');
    $mlm_no_of_level = $mlm_general_settings['mlm-level'];
    //most outer if condition
    if (isset($_POST['mlm_royalty_bonus_settings'])) {
        $per_ref = count(array_filter($_POST['per_ref']));
        $pay_value = count(array_filter($_POST['pay_value']));
        $level = $_POST['level'];
        if ($per_ref == 0) {
            $error .= "\n Please Specify No. of Personal Referral.";
        }
        if ($pay_value == 0) {
            $error .= "\n Please Specify Payout Value.";
        }
        if (checkInputField($level)) {
            $error .= "\n Please Select Level.";
        }
        //if any error occoured
        if (!empty($error)) {
            $error = nl2br($error);
        } else {
            $chk = '';
            update_option('wp_mlm_royalty_bonus_settings', $_POST);
            $url = get_bloginfo('url') . "/wp-admin/admin.php?page=admin-settings&tab=deduction";
            _e("<script>window.location='{$url}'</script>");
            $msg = _e("<span style='color:green;'>Your bonus has been successfully updated.</span>", 'unilevel-mlm-pro');
        }
    }
    // end outer if condition
    if ($chk != '') {
        $mlm_settings = get_option('wp_mlm_royalty_bonus_settings');
        ?>
<div class='wrap1'>
	<h2><?php 
        _e('Royalty Bonus Settings', 'unilevel-mlm-pro');
        ?>
  </h2>
	<div class="notibar msginfo">
		<a class="close"></a>
		<p><?php 
        _e('Royalty Bonus is a % bonus paid to a member on the total commissions earned by a particular level under the member.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('No. of Personal Referrers', 'unilevel-mlm-pro');
        ?>
 - </strong><?php 
        _e('This is the value of the personal referrers which would trigger a bonus distribution in the network.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Payout Value', 'unilevel-mlm-pro');
        ?>
 -</strong> <?php 
        _e('This is the payout value in terms of the percentage amount that would be paid to the member.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Level', 'unilevel-mlm-pro');
        ?>
 -</strong> <?php 
        _e(' The system would calculate the total commissions for Level X under the member and distribute a bonus equal to Y% (the payout value above) of the total commissions at Level X.', 'unilevel-mlm-pro');
        ?>
</p>
<p><?php 
        _e('eg. Slab 1 = Personal Referrals = 5, Payout Value = 2 and Level = Level 1, then the system would distribute a bonus equal to 2% of the total commission earned by all the members who are at Level of that member.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Option 1', 'unilevel-mlm-pro');
        ?>
</strong></p>
<p><?php 
        _e('If the first bonus slab is as above and the second bonus slab is as follows', 'unilevel-mlm-pro');
        ?>
</p>
<p><?php 
        _e('Slab 2 = Personal Referrals = 10, Payout Value = 4 and Level = Level 1.', 'unilevel-mlm-pro');
        ?>
</p>
</br>
<p><?php 
        _e('Then, if this member has already referred 10 or more people, he would stop earning the bonus for Slab 1 as he cannot earn both 2% and 4% bonus for the same level.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Option 2', 'unilevel-mlm-pro');
        ?>
</strong></p>
<p><?php 
        _e('The first and second bonus slabs are as above and the third bonus slab is as follows:', 'unilevel-mlm-pro');
        ?>
</p>
<p><?php 
//.........这里部分代码省略.........
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:101,代码来源:admin-mlm-royalty-bonus-settings.php

示例7: mlmDeduction

function mlmDeduction()
{
    //get database table prefix
    $table_prefix = mlm_core_get_table_prefix();
    $error = '';
    $chk = 'error';
    //most outer if condition
    if (isset($_POST['mlm_withdrawal_settings'])) {
        $withdwl_mthd = count(array_filter($_POST['withdwl_mthd']));
        $withdwl_type = $_POST['withdwl_type'];
        $withdwl_amt = count(array_filter($_POST['withdwl_amt']));
        if ($withdwl_mthd == 0) {
            $error .= "\n Please Specify Name of Withdrawal Method.";
        }
        if ($withdwl_amt == 0) {
            $error .= "\n Please Specify Amount.";
        }
        if (checkInputField($withdwl_type)) {
            $error .= "\n Please Specify Type.";
        }
        //if any error occoured
        if (!empty($error)) {
            $error = nl2br($error);
        } else {
            $chk = '';
            update_option('wp_mlm_withdrawal_method_settings', $_POST);
            $url = get_bloginfo('url') . "/wp-admin/admin.php?page=admin-settings&tab=deduction";
            _e("<script>window.location='{$url}'</script>");
            $msg = _e("<span style='color:green;'>Your Withdrawal Settings has been successfully updated.</span>", 'unilevel-mlm-pro');
        }
    } else {
        if (isset($_POST['mlm_other_method_settings'])) {
            $othr_mthd = count(array_filter($_POST['othr_mthd']));
            $othr_type = $_POST['othr_type'];
            $othr_amt = count(array_filter($_POST['othr_amt']));
            if ($othr_mthd == 0) {
                $error .= "\n Please Specify Name of Other Method.";
            }
            if ($othr_amt == 0) {
                $error .= "\n Please Specify Amount.";
            }
            if (checkInputField($othr_type)) {
                $error .= "\n Please Specify Type.";
            }
            //if any error occoured
            if (!empty($error)) {
                $error = nl2br($error);
            } else {
                $chk = '';
                update_option('wp_mlm_other_method_settings', $_POST);
                $url = get_bloginfo('url') . "/wp-admin/admin.php?page=admin-settings&tab=deduction";
                _e("<script>window.location='{$url}'</script>");
                $msg = _e("<span style='color:green;'>Your Other Method Settings has been successfully updated.</span>", 'unilevel-mlm-pro');
            }
        }
    }
    // end outer if condition
    if ($chk != '') {
        $mlm_withdrawal_settings = get_option('wp_mlm_withdrawal_method_settings');
        $mlm_other_settings = get_option('wp_mlm_other_method_settings');
        ?>
<div class='wrap1'>
	<h2><?php 
        _e('Deductions Settings', 'unilevel-mlm-pro');
        ?>
  </h2>
	<div class="notibar msginfo">
		<a class="close"></a>
		<p><?php 
        _e('These settings will define the amounts that would be deducted from the withdrawals made by members in their Member\'s Area.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Withdrawal	Methods', 'unilevel-mlm-pro');
        ?>
 - </strong></p>
<p><?php 
        _e('You can configure the various withdrawal methods and the amount (fixed or percentage) that would be deductible if the member opts for a particular method of withdrawal.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Other	deductions', 'unilevel-mlm-pro');
        ?>
 -</strong> </p>
<p><?php 
        _e('You can configure other deductions that would be deducted from a withdrawal. Typical examples could include a general service charge, withholding tax or any other amount that you like to deduct from the withdrawal amount.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Note ', 'unilevel-mlm-pro');
        ?>
 : </strong> 
<?php 
        _e('All % amounts would always apply the specified % to the actual amount withdrawn.', 'unilevel-mlm-pro');
        ?>
</p>
</div>
	
	<?php 
        if ($error) {
//.........这里部分代码省略.........
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:101,代码来源:admin-mlm-deduction-settings.php

示例8: register_user_html_page

function register_user_html_page()
{
    global $wpdb;
    $table_prefix = mlm_core_get_table_prefix();
    $error = '';
    $chk = 'error';
    global $current_user;
    get_currentuserinfo();
    $user_roles = $current_user->roles;
    $user_role = array_shift($user_roles);
    if (!empty($_GET['sp_name'])) {
        $sp_name = $_GET['sp_name'];
        ?>
		 <script>$.cookie('s_name','<?php 
        echo $sp_name;
        ?>
',{ path: '/' });</script>
	       
	       <?php 
        //setcookie("s_name", $sp_name);
    } else {
        if (!empty($_GET['sp'])) {
            $sp_name = getusernamebykey($_GET['sp']);
            ?>
		 <script>$.cookie('s_name','<?php 
            echo $sp_name;
            ?>
',{ path: '/' });</script>
	       
	       <?php 
        } else {
            $sp_name = $_COOKIE["s_name"];
        }
    }
    //echo $_COOKIE["s_name"]."hello";
    //get no. of level
    $mlm_general_settings = get_option('wp_mlm_general_settings');
    $mlm_no_of_level = $mlm_general_settings['mlm-level'];
    $mlm_pay_settings = get_option('wp_mlm_payment_settings');
    $mlm_method = get_option('wp_mlm_payment_method');
    if (is_user_logged_in()) {
        $sponsor_name = $current_user->user_login;
        $readonly_sponsor = 'readonly';
        $spnsr_set = 1;
    } else {
        if (isset($_REQUEST['sp_name']) && $_REQUEST['sp_name'] != '') {
            //$sponsorName = getusernamebykey($_REQUEST['sp']);
            $sponsorName = $_REQUEST['sp_name'];
            if (isset($sponsorName) && $sponsorName != '') {
                $readonly_sponsor = 'readonly';
                $sponsor_name = $sponsorName;
            } else {
                redirectPage(home_url(), array());
                exit;
            }
        } else {
            if (isset($_COOKIE["s_name"]) && $_COOKIE["s_name"] != '') {
                $readonly_sponsor = 'readonly';
                $sponsor_name = $_COOKIE["s_name"];
            } else {
                if (isset($_REQUEST['sp']) && $_REQUEST['sp'] != '') {
                    //$sponsorName = getusernamebykey($_REQUEST['sp']);
                    $sponsorName = getusernamebykey($_REQUEST['sp']);
                    if (isset($sponsorName) && $sponsorName != '') {
                        $readonly_sponsor = 'readonly';
                        $sponsor_name = $sponsorName;
                    } else {
                        redirectPage(home_url(), array());
                        exit;
                    }
                } else {
                    // $sponsor_name = get_top_level_user();
                    //$readonly_sponsor = 'readonly';
                    $readonly_sponsor = '';
                }
            }
        }
    }
    //most outer if condition
    if (isset($_POST['submit'])) {
        $firstname = sanitize_text_field($_POST['firstname']);
        $lastname = sanitize_text_field($_POST['lastname']);
        $username = sanitize_text_field($_POST['username']);
        /******* check for the epin field ******/
        if (isset($_POST['epin']) && !empty($_POST['epin'])) {
            $epin = sanitize_text_field($_POST['epin']);
        } else {
            if (isset($_POST['epin']) && empty($_POST['epin'])) {
                $epin = '';
            }
        }
        /******* check for the epin field ******/
        $password = sanitize_text_field($_POST['password']);
        $confirm_pass = sanitize_text_field($_POST['confirm_password']);
        $email = sanitize_text_field($_POST['email']);
        $confirm_email = sanitize_text_field($_POST['confirm_email']);
        $sponsor = sanitize_text_field($_POST['sponsor']);
        /*$address1 = sanitize_text_field( $_POST['address1'] );
        		$address2 = sanitize_text_field( $_POST['address2'] );
        		city = sanitize_text_field( $_POST['city'] );
//.........这里部分代码省略.........
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:101,代码来源:mlm-registration-page.php

示例9: mlm_core_drop_tables

function mlm_core_drop_tables()
{
    global $wpdb;
    $table_prefix = mlm_core_get_table_prefix();
    mlm_core_delete_users_data();
    $wpdb->query("DROP TABLE {$table_prefix}mlm_users");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_leftleg");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_rightleg");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_country");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_currency");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_commission");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_bonus");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_payout");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_payout_master");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_referral_commission");
    $wpdb->query("DROP TABLE {$table_prefix}mlm_epins");
}
开发者ID:EvandroEpifanio,项目名称:binary-mlm-pro,代码行数:17,代码来源:mlm-core-schema.php

示例10: mlm_my_child_member_details_page

function mlm_my_child_member_details_page()
{
    $table_prefix = mlm_core_get_table_prefix();
    $error = '';
    global $current_user;
    get_currentuserinfo();
    $sponsor_name = $current_user->user_login;
    if (!empty($_GET['lvl']) && $_GET['lvl'] != '') {
        $level = $_GET['lvl'];
    }
    $res = mysql_fetch_array(mysql_query("SELECT user_key FROM {$table_prefix}mlm_users WHERE username = '" . $sponsor_name . "'"));
    $level_data = getLevelInfo($res['user_key'], $level);
    ?>
 
<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 =
  {cols:[
	{id:'A',label:'<?php 
    echo _e("Username", "unilevel-mlm-pro");
    ?>
',type:'string'},
	{id:'B',label:'<?php 
    echo _e("First Name", "unilevel-mlm-pro");
    ?>
',type:'string'},
	{id:'C',label:'<?php 
    echo _e("Last Name", "unilevel-mlm-pro");
    ?>
',type:'string'},
    {id:'D',label:'<?php 
    echo _e("Sponsor", "unilevel-mlm-pro");
    ?>
',type:'string'},
	{id:'E',label:'<?php 
    echo _e("Email", "unilevel-mlm-pro");
    ?>
',type:'string'},
    {id:'F',label:'<?php 
    echo _e("Status", "unilevel-mlm-pro");
    ?>
',type:'string'}],
  rows:[
  <?php 
    for ($i = 0; $i < count($level_data); $i++) {
        ?>
                        {c:[{v:'<?php 
        echo $level_data[$i]['username'];
        ?>
'},
                        {v:'<?php 
        echo $level_data[$i]['first_name'];
        ?>
'},
                        {v:'<?php 
        echo $level_data[$i]['last_name'];
        ?>
'},
                        {v:'<?php 
        echo $level_data[$i]['sponsor'];
        ?>
'},
						{v:'<?php 
        echo $level_data[$i]['email'];
        ?>
'},
                        {v:'<?php 
        echo $level_data[$i]['status'];
        ?>
'}]},
  <?php 
    }
    ?>
  ]};
  data = new google.visualization.DataTable(dataAsJson);
  // Set paging configuration options
  // Note: these options are changed by the UI controls in the example.
  options['page'] = 'enable';
  options['pageSize'] = 10;
  options['pagingSymbols'] = {prev: 'prev', next: 'next'};
  options['pagingButtonsConfiguration'] = 'auto';
  //options['allowHtml'] = true;
  //data.sort({column:1, desc: false});
  // Create and draw the visualization.
  visualization = new google.visualization.Table(document.getElementById('table'));
  draw();
}
function draw() {
  visualization.draw(data, options);
}
google.setOnLoadCallback(drawVisualization);
// sets the number of pages according to the user selection.
//.........这里部分代码省略.........
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:101,代码来源:mlm-view-child-level-member.php

示例11: register_user_html_page

function register_user_html_page()
{
    global $wpdb, $current_user;
    $user_id = $current_user->ID;
    $table_prefix = mlm_core_get_table_prefix();
    $error = '';
    $chk = 'error';
    include_once ABSPATH . '/wp-admin/includes/plugin.php';
    if (!empty($_GET['sp_name'])) {
        $sp_name = $wpdb->get_var("select username from {$table_prefix}mlm_users where username='" . $_GET['sp_name'] . "'");
        if ($sp_name) {
            ?>
            <script type='text/javascript'>
                $.cookie('sp_name', '<?php 
            echo $sp_name;
            ?>
', {path: '/'});
            </script>
            <?php 
        }
    } else {
        if (!empty($_REQUEST['sp'])) {
            $sp_name = getusernamebykey($_REQUEST['sp']);
            if ($sp_name) {
                ?>
            <script type='text/javascript'>
                $.cookie('sp_name', '<?php 
                echo $sp_name;
                ?>
', {path: '/'});
            </script>
            <?php 
            }
        } else {
            $sp_name = empty($_COOKIE["sp_name"]) ? '' : $_COOKIE["sp_name"];
        }
    }
    get_currentuserinfo();
    $mlm_general_settings = get_option('wp_mlm_general_settings');
    if (is_user_logged_in()) {
        $sponsor_name = $current_user->user_login;
        $readonly_sponsor = 'readonly';
    } else {
        if (isset($_REQUEST['sp']) && $_REQUEST['sp'] != '') {
            $sponsorName = getusernamebykey($_REQUEST['sp']);
            if (isset($sponsorName) && $sponsorName != '') {
                $readonly_sponsor = 'readonly';
                $sponsor_name = $sponsorName;
            } else {
                redirectPage(home_url(), array());
                exit;
            }
        } else {
            if (!empty($_REQUEST['sp_name'])) {
                $sponsorName = $_REQUEST['sp_name'];
                if (!empty($sponsorName)) {
                    $readonly_sponsor = 'readonly';
                    $sponsor_name = $sponsorName;
                } else {
                    redirectPage(home_url(), array());
                    exit;
                }
            } else {
                $readonly_sponsor = '';
            }
        }
    }
    /* script for auto insert users================================================ */
    if ($_SERVER['HTTP_HOST'] == '192.168.100.100') {
        echo '<form name="form1"action="" method="post">
      <input type="number" min="0" max="99" name="id"/>
      <input type="number" min="0" max="1" name="epin"/>
      <input type="number" min="0" max="1" name="leg"/>
      <input type="submit"/></form>';
        $epinstatus = isset($_POST['epin']) ? $_POST['epin'] : '';
        if ($epinstatus != '') {
            $epin_no = $wpdb->get_var("select epin_no from {$table_prefix}mlm_epins where  point_status='{$epinstatus}' AND status=0 limit 1 ");
        }
        if (isset($_POST['id'])) {
            $z = $_POST['id'];
            $_POST = array('firstname' => 'binary' . $z, 'lastname' => 'binary' . $z, 'username' => 'binary' . $z, 'password' => 'binary' . $z, 'confirm_password' => 'binary' . $z, 'email' => 'binary' . $z . '@gmail.com', 'confirm_email' => 'binary' . $z . '@gmail.com', 'sponsor' => !empty($sponsor_name) ? $sponsor_name : '', 'submit' => 'submit', 'leg' => $_POST['leg'], 'epin' => $epin_no, 'paypal_id' => 'binary' . $z . '@gmail.com');
        }
        //'epin'=>!empty($epin_no)?$epin_no:'',
        //echo "<pre>"; print_r($_SERVER); echo "</pre>";
    }
    /* ===========================================================Close Auto Insert. */
    //most outer if condition
    if (isset($_POST['submit'])) {
        $firstname = sanitize_text_field($_POST['firstname']);
        $lastname = sanitize_text_field($_POST['lastname']);
        $username = sanitize_text_field($_POST['username']);
        $epin = sanitize_text_field(isset($_POST['epin']) ? $_POST['epin'] : '');
        $sponsor = sanitize_text_field($_POST['sponsor']);
        $password = sanitize_text_field($_POST['password']);
        $confirm_pass = sanitize_text_field($_POST['confirm_password']);
        $email = sanitize_text_field($_POST['email']);
        $confirm_email = sanitize_text_field($_POST['confirm_email']);
        $invalid_usernames = array('admin');
        $username = sanitize_user($username);
        if (!validate_username($username) || in_array($username, $invalid_usernames)) {
//.........这里部分代码省略.........
开发者ID:EvandroEpifanio,项目名称:binary-mlm-pro,代码行数:101,代码来源:mlm-registration-page.php

示例12: viewUnilevelNetworkPage

function viewUnilevelNetworkPage()
{
    $table_prefix = mlm_core_get_table_prefix();
    //$obj = new UnilevelTree();
    global $current_user, $wpdb;
    get_currentuserinfo();
    $username1 = $current_user->user_login;
    //get no. of level
    $mlm_general_settings = get_option('wp_mlm_general_settings');
    $mlm_no_of_level = $mlm_general_settings['mlm-level'];
    $res = mysql_fetch_array(mysql_query("SELECT user_key FROM {$table_prefix}mlm_users WHERE username = '" . $username1 . "'"));
    $total = mysql_fetch_array(mysql_query("SELECT count(*) as num FROM {$table_prefix}mlm_hierarchy WHERE pid = '" . $res['user_key'] . "'"));
    $total = $total['num'];
    $member_page_id = $wpdb->get_var("SELECT id FROM {$table_prefix}posts  WHERE `post_content` LIKE '%mlm-view-child-level-member%'\tAND `post_type` != 'revision'");
    /*	$level[0]=countLevelMember($res['user_key']);
    	$user[0]=returnMemberUserkey($res['user_key']);
    
    $total=$level[0];
    
    for($i=1;$i<$mlm_no_of_level;$i++) {
    
    $user[$i]=returnMemberUserkey($user[$i-1]);
    $level[$i]=countLevelMember($user[$i-1]);
    
    
    if($level[$i]==0 || $level[$i]=='') {
    $level[$i]="No Any Members";
    }
    else {
    $total=$level[$i]+$total;
    }
    
    }*/
    //print_r($level);
    ?>
	<style type="text/css">
		span.owner
		{
			color:#339966; 
			font-style:italic;
		}
		span.paid
		{
			color: #669966!important; 
			/*background-color:#770000; */
			font-style:normal;
		}
		span.leg
		{
			color:red; 
			font-style:italic;
		}
	</style>

<script type="text/javascript" language="javascript">
	function searchUser()
	{
		var user = document.getElementById("username").value;
		if(user=="")
		{
			alert("Please enter username then searched.");
			document.getElementById("username").focus();
			return false;
		}
	}
</script>
 		<table border="0" cellspacing="0" cellpadding="0" >
			<tr>

			<td align="center">
				<form name="usersearch" id="usersearch" action="" method="post" onSubmit="return searchUser();">
					<input type="text" name="username" id="username"> <input type="submit" name="search" value="Search">
				</form>
			</td>
		</tr>               
		</table>
		
		<?php 
    if (isset($_POST['search'])) {
        $Search = $_POST['username'];
        $qry = mysql_query("SELECT user_key,h.level as level FROM {$table_prefix}mlm_hierarchy as h INNER JOIN {$table_prefix}mlm_users as u ON u.user_key=h.cid WHERE h.pid = '" . $res['user_key'] . "' AND u.username LIKE ('%" . $Search . "%')");
        $num = mysql_num_rows($qry);
        if ($num > 0) {
            while ($result = mysql_fetch_array($qry)) {
                $user = array();
                $usr_dtls = mysql_fetch_array(mysql_query("SELECT user_id,username,sponsor_key,payment_status FROM {$table_prefix}mlm_users WHERE user_key='" . $result['user_key'] . "'"));
                $user['username'] = $usr_dtls['username'];
                $user['first_name'] = get_user_meta($usr_dtls['user_id'], 'first_name', true);
                $user['last_name'] = get_user_meta($usr_dtls['user_id'], 'last_name', true);
                $sponser_id = $usr_dtls['sponsor_key'];
                $user['sponsor'] = getusernamebykey($sponser_id);
                $email = $wpdb->get_var("SELECT user_email FROM {$table_prefix}users WHERE ID='" . $usr_dtls['user_id'] . "'");
                $user['email'] = $email;
                $user['level'] = $result['level'];
                if ($usr_dtls['payment_status'] == 1) {
                    $user['status'] = "Paid";
                } else {
                    $user['status'] = "Not Paid";
                }
                $user_data[] = $user;
//.........这里部分代码省略.........
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:101,代码来源:mlm-view-network.php

示例13: widget

    function widget($args, $instance)
    {
        extract($args);
        $table_prefix = mlm_core_get_table_prefix();
        global $wpdb;
        $title = apply_filters('widget_title', $instance['title']);
        $textarea = $instance['textarea'];
        $ckemail = get_option('ckemail');
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if ($textarea) {
            echo '<p>' . $textarea . '</p>';
        }
        if (!empty($_GET['sp_name'])) {
            $sp_name = $_GET['sp_name'];
        } else {
            if (!empty($_GET['sp'])) {
                $sp_name = getusernamebykey($_GET['sp']);
            } else {
                if (!empty($_COOKIE["sp_name"])) {
                    $sp_name = $_COOKIE["sp_name"];
                }
            }
        }
        //$sp_name = empty($_COOKIE["sp_name"])?'':$_COOKIE["sp_name"];
        if (is_user_logged_in()) {
            $current_user = wp_get_current_user();
            $cuserid = $current_user->ID;
            $cusername = $current_user->user_firstname . ' ' . $current_user->user_lastname;
            $cemail = $current_user->user_email;
            $all_meta_for_user = get_user_meta($cuserid);
            ?>
  
            <div class="join_box">
                <div class="join_box_left" style="width:90px;float:left;">
                    <?php 
            echo get_avatar($cuserid, 80);
            ?>
                </div>
                <div class="join_box_right">
                    <?php 
            echo '<span class="swname">' . ucwords(empty($cusername) ? '' : $cusername) . '</span><br/>';
            if (!empty($ckemail)) {
                ?>
                        <span class='swemail'><?php 
                echo empty($cemail) ? '' : $cemail;
                ?>
</span><br/><br/>
                        <?php 
            } else {
                echo '<br/>';
            }
            ?>
                    <input type="button" value="Join Now" class="primary button" onclick="window.location = '<?php 
            echo get_post_id_or_postname('mlm_registration_page', 'binary-mlm-pro');
            ?>
'" />
                </div>
            </div>
            <?php 
        } else {
            if (!empty($sp_name)) {
                $userid = $wpdb->get_var("SELECT user_id FROM {$table_prefix}mlm_users WHERE username = '" . $sp_name . "'");
                if (!empty($userid)) {
                    $all_meta_for_user = get_user_meta($userid);
                    $fname = $all_meta_for_user['first_name'][0];
                    $lname = $all_meta_for_user['last_name'][0];
                    $fullname = $fname . ' ' . $lname;
                    $user_info = get_userdata($userid);
                    $email = $user_info->user_email;
                    $permalink = get_permalink(empty($_GET['page_id']) ? '' : $_GET['page_id']);
                    $postidparamalink = strstr($permalink, 'page_id');
                    $concat = $postidparamalink ? '&' : '/?';
                }
                ?>
                <div class="join_box">
                    <div class="join_box_left" style="width:90px;float:left;">
                        <?php 
                echo get_avatar($userid, 80);
                ?>
                    </div>
                    <div class="join_box_right">
                        <?php 
                echo '<span class="swname">' . ucwords(empty($fullname) ? '' : $fullname) . '</span><br/>';
                if (!empty($ckemail)) {
                    ?>
                            <span class='swemail'><?php 
                    echo empty($email) ? '' : $email;
                    ?>
</span><br/><br/>
                            <?php 
                } else {
                    echo '<br/>';
                }
                ?>
                        <input type="button" value="Join Now" class="primary button" onclick="window.location = '<?php 
                echo get_post_id_or_postname('mlm_registration_page', 'binary-mlm-pro');
                echo empty($concat) ? '/?' : $concat;
//.........这里部分代码省略.........
开发者ID:EvandroEpifanio,项目名称:binary-mlm-pro,代码行数:101,代码来源:default-widgets.php

示例14: mlmRegularBonus

function mlmRegularBonus()
{
    //get database table prefix
    $table_prefix = mlm_core_get_table_prefix();
    $error = '';
    $chk = 'error';
    //get no. of level
    $mlm_general_settings = get_option('wp_mlm_general_settings');
    $mlm_no_of_level = $mlm_general_settings['mlm-level'];
    //most outer if condition
    if (isset($_POST['mlm_regular_bonus_settings'])) {
        $per_ref = count(array_filter($_POST['per_ref']));
        $pay_value = count(array_filter($_POST['pay_value']));
        if ($per_ref == 0) {
            $error .= "\n Please Specify No. of Personal Referral.";
        }
        if ($pay_value == 0) {
            $error .= "\n Please Specify Payout Value.";
        }
        //if any error occoured
        if (!empty($error)) {
            $error = nl2br($error);
        } else {
            $chk = '';
            update_option('wp_mlm_regular_bonus_settings', $_POST);
            $url = get_bloginfo('url') . "/wp-admin/admin.php?page=admin-settings&tab=royalty_bonus";
            _e("<script>window.location='{$url}'</script>");
            $msg = _e("<span style='color:green;'>Your bonus has been successfully updated.</span>", 'unilevel-mlm-pro');
        }
    }
    // end outer if condition
    if ($chk != '') {
        $mlm_settings = get_option('wp_mlm_regular_bonus_settings');
        ?>
<div class='wrap1'>
	<h2><?php 
        _e('Regular Bonus Settings', 'unilevel-mlm-pro');
        ?>
  </h2>
	<div class="notibar msginfo">
		<a class="close"></a>
		<p><?php 
        _e('Regular bonus is a one time payment made to a member in the network based on the number of personal referrers. To add a new bonus slab click the Add Row Button. To delete a particular bonus slab, select the checkbox against the slab and click the Delete Row Button.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('No. of Personal Referrers', 'unilevel-mlm-pro');
        ?>
 - </strong><?php 
        _e('This is the value of the personal referrers  which would trigger a bonus distribution in the network. If the first slab has a value of 5 personal referrers while the next slab has 10 personal referrers, this implies that the member has to sponsor 5 members to get the bonus of Slab1 and a total of 15 members (10 more members) in the network in order to get the bonus for the
Slab2.', 'unilevel-mlm-pro');
        ?>
</p>
<p><strong><?php 
        _e('Payout Value', 'unilevel-mlm-pro');
        ?>
 -</strong> <?php 
        _e('This is the fixed payout   amount paid to the member on achieving the milestone.', 'unilevel-mlm-pro');
        ?>
</p>

	</div>
	
	<?php 
        if ($error) {
            ?>
	<div class="notibar msgerror">
		<a class="close"></a>
		<p> <strong><?php 
            _e('Please Correct the following Error', 'unilevel-mlm-pro');
            ?>
 :</strong> <?php 
            _e($error);
            ?>
</p>
	</div>
	<?php 
        }
        ?>
	<?php 
        if (!empty($msg)) {
            ?>
	<div class="notibar msgerror">
		<a class="close"></a>
		<p><?php 
            _e($msg);
            ?>
</p>
	</div>
	<?php 
        }
        ?>
	

<?php 
        if (empty($mlm_settings)) {
            ?>
<form name="admin_bonus_settings" method="post" action="">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" class="form-table">
		
//.........这里部分代码省略.........
开发者ID:sp1ke77,项目名称:unilevel-mlm-pro,代码行数:101,代码来源:admin-mlm-regular-bonus-settings.php

示例15: adminMLMSettings

function adminMLMSettings()
{
    global $pagenow, $wpdb;
    $table_prefix = mlm_core_get_table_prefix();
    $mlm_settings = get_option('wp_mlm_general_settings');
    $sql = "SELECT COUNT(*) AS num FROM {$table_prefix}mlm_users";
    $num = $wpdb->get_var($sql);
    if ($num == 0) {
        $tabs = array('createuser' => __('Create First User', 'binary-mlm-pro'), 'general' => __('General', 'binary-mlm-pro'), 'eligibility' => __('Eligibility', 'binary-mlm-pro'), 'payout' => __('Payout', 'binary-mlm-pro'), 'bonus' => __('Bonus', 'binary-mlm-pro'), 'email' => __('Email Settings', 'binary-mlm-pro'));
        if (isset($mlm_settings['ePin_activate']) && $mlm_settings['ePin_activate'] == '1') {
            $tabs['epin_settings'] = __('ePins', 'binary-mlm-pro');
            $tabs['product_price'] = __('Manage Products', 'binary-mlm-pro');
        }
        /**
         * Detect plugin. For use in Admin area only.
         */
        include_once ABSPATH . '/wp-admin/includes/plugin.php';
        if (is_plugin_active('mlm-paypal-mass-pay/load-data.php')) {
            //plugin is activated
            $tabs['paypal_detail'] = __('Paypal Details', 'binary-mlm-pro');
        }
        $tabs['reset_all_data'] = __('Reset All MLM Data', 'binary-mlm-pro');
        $tabval = 'createuser';
        $tabfun = 'register_first_user';
    } else {
        $tabs = array('general' => __('General', 'binary-mlm-pro'), 'eligibility' => __('Eligibility', 'binary-mlm-pro'), 'payout' => __('Payout', 'binary-mlm-pro'), 'bonus' => __('Bonus', 'binary-mlm-pro'), 'email' => __('Email Settings', 'binary-mlm-pro'));
        if (isset($mlm_settings['ePin_activate']) && $mlm_settings['ePin_activate'] == '1') {
            $tabs['epin_settings'] = __('ePins', 'binary-mlm-pro');
            $tabs['product_price'] = __('Manage Products', 'binary-mlm-pro');
        }
        if (is_plugin_active('mlm-paypal-mass-pay/load-data.php')) {
            //plugin is activated
            $tabs['paypal_detail'] = __('Paypal Details', 'binary-mlm-pro');
        }
        $tabs['reset_all_data'] = __('Reset All MLM Data', 'binary-mlm-pro');
        $tabval = 'general';
        $tabfun = 'mlmGeneral';
    }
    if (!empty($_GET['tab'])) {
        if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'createuser') {
            $current = 'createuser';
        } else {
            if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'general') {
                $current = 'general';
            } else {
                if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'eligibility') {
                    $current = 'eligibility';
                } else {
                    if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'payout') {
                        $current = 'payout';
                    } else {
                        if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'bonus') {
                            $current = 'bonus';
                        } else {
                            if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'email') {
                                $current = 'email';
                            } else {
                                if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'epin_settings') {
                                    $current = 'epin_settings';
                                } else {
                                    if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'product_price') {
                                        $current = 'product_price';
                                    } else {
                                        if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'paypal_detail') {
                                            $current = 'paypal_detail';
                                        } else {
                                            if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'reset_all_data') {
                                                $current = 'reset_all_data';
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    } else {
        $current = $tabval;
    }
    $links = array();
    _e('<div id="icon-themes" class="icon32"><br></div>');
    _e("<h1>MLM Settings</h1>", "binary-mlm-pro");
    _e('<h2 class="nav-tab-wrapper">');
    foreach ($tabs as $tab => $name) {
        $class = $tab == $current ? ' nav-tab-active' : '';
        _e("<a class='nav-tab{$class}' href='?page=admin-settings&tab={$tab}'>{$name}</a>");
    }
    _e('</h2>');
    if (!empty($_GET['tab'])) {
        if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'createuser') {
            register_first_user();
        } else {
            if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'general') {
                mlmGeneral();
            } else {
                if ($pagenow == 'admin.php' && $_GET['page'] == 'admin-settings' && $_GET['tab'] == 'eligibility') {
                    mlmEligibility();
                } else {
//.........这里部分代码省略.........
开发者ID:EvandroEpifanio,项目名称:binary-mlm-pro,代码行数:101,代码来源:admin-mlm-settings.php


注:本文中的mlm_core_get_table_prefix函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。