Exemple #1
0
<?php

$ACCESS_LEVEL = ACCESS_LEVEL_ADMIN;
include_once DOC_ROOT . '/includes/authorization.php';
include_once LIB_ROOT . '/users/statistics.class.php';
$stats = new Statistics();
$stats->select = ' sum(amount) as sum ';
$deposited = $stats->getLines(array('d'), 2);
$reinvested = $stats->getLines(array('i'), 1);
$earned = $stats->getLines(array('e'), 1);
$withdrawn = $stats->getLines(array('w'), 1);
$referral_bonuses = $stats->getLines(array('r'), 1);
Project::getInstance()->getSmarty()->assign('deposited', $deposited[0]['sum'] - abs($reinvested[0]['sum']));
Project::getInstance()->getSmarty()->assign('reinvested', $reinvested[0]['sum']);
Project::getInstance()->getSmarty()->assign('earned', $earned[0]['sum']);
Project::getInstance()->getSmarty()->assign('withdrawn', $withdrawn[0]['sum']);
Project::getInstance()->getSmarty()->assign('referral_bonuses', $referral_bonuses[0]['sum']);
include_once LIB_ROOT . '/liberty.class.php';
$LR = new LibertyReserve(get_setting('lr_api'), get_setting('lr_api_secword'));
Project::getInstance()->getSmarty()->assign('lr_balance', $LR->getBalance(get_setting('lr_account')));
include_once LIB_ROOT . '/perfect.class.php';
$PM = new PerfectMoney(get_setting('pm_member_id'), get_setting('pm_password'));
$balance = $PM->getBalance();
Project::getInstance()->getSmarty()->assign('pm_balance', $balance[get_setting('pm_account')]);
include_once LIB_ROOT . '/php-ofc-library/open-flash-chart-object.php';
Project::getInstance()->getSmarty()->assign('chart', open_flash_chart_object_str(1000, 500, 'chart-data.php', false, '/admin/'));
Project::getInstance()->getSmarty()->display('../default/admin/statistics.tpl');
Exemple #2
0
				SET 
					status="1", 
					batch="' . $reciept_id . '" 
				WHERE 
					id="' . $payment_id . '"');
            if (Project::getInstance()->getCurUser()->withdrawal_notify) {
                include_once LIB_ROOT . '/emails.class.php';
                //%user_fullname%, %user_login%, %amount%, %batch%, %access_time%, %account%, %project_name%, %project_email%
                $params = array('%user_fullname%' => htmlspecialchars($user['fullname']), '%user_login%' => $user['login'], '%account%' => $user['account'], '%amount%' => floatval($_POST['amount']), '%batch%' => $reciept_id, '%project_name%' => get_setting('project_name'), '%project_email%' => get_setting('project_email'), '%access_time%' => date('M d, Y H:i', Project::getInstance()->getNow()));
                $email = new Emails(Project::getInstance()->getCurUser()->id, 'withdrawal_notify', $params);
                $email->send();
            }
            location($_SERVER['PHP_SELF'], '<p class=imp><strong>Achievement:</strong> Operation has been completed, check your account!</p>');
        } else {
            //���� �� ������ ������, �� ���������� � bad_withdrawals
            $gw_balance = $gateway->getBalance($account);
            if (Project::getInstance()->getCurUser()->payment_system == 'PM') {
                $gw_balance = $gw_balance[get_setting('pm_account')];
            }
            sql_query('
				INSERT INTO bad_withdrawals 
				SET 
					id=0, 
					user_id="' . $user['id'] . '", 
					amount= "' . floatval($_POST['amount']) . '", 
					gw_balance="' . floatval($gw_balance) . '", 
					stamp="' . Project::getInstance()->getNow() . '"');
            location($_SERVER['PHP_SELF'], '<p class=imp><strong>Notification:</strong> The action can not be done, please try again later!</p>');
        }
    } else {
        location($_SERVER['PHP_SELF'], '<p class=imp><strong>Alert:</strong> You have defined not valid amount or your available balance is too low to request the withdrawal!');