Пример #1
0
    case 'statistics':
        include_once LIB_ROOT . '/users/statistics.class.php';
        $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'a';
        if ($type == 'a') {
            $types = array('d', 'w', 'e', 'r', 'b');
            $status = array('1', '2');
        } elseif ($type == 'd') {
            $types = array('d');
            $status = 2;
        } else {
            $types = array($type);
            $status = 1;
        }
        $stats = new Statistics(intval($_REQUEST['id']));
        $stats->select = '*';
        $lines = $stats->getLines($types, $status);
        Project::getInstance()->getSmarty()->assign('lines', $lines);
        Project::getInstance()->getSmarty()->assign('user_id', intval($_REQUEST['id']));
        Project::getInstance()->getSmarty()->display('../default/admin/user_statistics.tpl');
        break;
    case 'bonus':
        if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
            $_POST = sql_escapeArray($_POST);
            sql_query('
				INSERT INTO translines
				SET
					id=0,
					parent_id=0,
					user_id="' . intval($_POST['id']) . '",
					plan_id=0,
					type="b",
Пример #2
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');