Exemplo n.º 1
0
function um_withdraw_request()
{
    $uid = get_current_user_id();
    $success = 0;
    $msg = '';
    if (!$uid) {
        return;
    }
    $num = isset($_POST['money']) ? $_POST['money'] : 0;
    $withdraw = um_get_withdraw_sum($uid, '');
    $sum = get_um_aff_sum_money($uid);
    $left = $sum - $withdraw - $num;
    if (0 > $left) {
        $msg = '提现金额不能大于推广余额';
    } else {
        $withdraw = $withdraw + $num;
        $add = um_add_withdraw_record($uid, '', $num, $left, 0);
        if ($add) {
            um_withdraw_admin_email($uid, $num, $left);
            $success = 1;
            $msg = '提现申请提交成功,请等待管理员处理';
        } else {
            $msg = '提现申请提交失败,请刷新页面再试';
        }
    }
    $return = json_encode(array('success' => $success, 'msg' => $msg));
    echo $return;
    exit;
}
Exemplo n.º 2
0
<?php 
        if (isset($_GET['currency']) && in_array($_GET['currency'], array('cash', 'credit'))) {
            $currency = $_GET['currency'];
        } else {
            $currency = 'cash';
        }
        $aLog = get_um_aff_sum_orders($curauth->ID, $currency, $number, $offset);
        $aall = $aLog ? count($aLog) : 0;
        $pages = ceil($aall / $number);
        ?>
	<p id="aff">你的永久推广链接为 <input class="um_aff_url" type="text" name="spreadurl" style="min-width:240px;width:60%;" value="<?php 
        echo get_bloginfo('url') . '/?aff=' . $current_user->ID;
        ?>
" disabled="disabled"></p>
<?php 
        $sum_rewards = get_um_aff_sum_money($curauth->ID);
        $withdrawed = um_get_withdraw_sum($curauth->ID, 'withdrawed');
        $withdrawing = um_get_withdraw_sum($curauth->ID, 'withdrawing');
        $left = $sum_rewards - $withdrawed - $withdrawing;
        if ($currency == 'cash') {
            $type = '现金';
            $otype = '积分';
            $link = um_get_user_url('affiliate', $curauth->ID) . '&currency=credit';
        } else {
            $type = '积分';
            $otype = '现金';
            $link = um_get_user_url('affiliate', $curauth->ID) . '&currency=cash';
        }
        $item_html = '<li class="contextual" style="background:#ceface;color:#44a042;">' . sprintf(__('全站共有 %1$s 条%2$s推广用户记录,点击查看<a href="%3$s">%4$s</a>推广用户记录。', 'um'), $aall, $type, $link, $otype) . '</li>';
        $item_html .= '<div class="site-orders">
			<table width="100%" border="0" cellspacing="0" class="table table-bordered orders-table">